1
0
forked from aniani/vim

updated for version 7.2a

This commit is contained in:
Bram Moolenaar
2008-06-24 22:09:24 +00:00
parent 446cb837a0
commit c1a11ed54c
45 changed files with 6607 additions and 317 deletions

View File

@@ -56,7 +56,7 @@ pum_display(array, size, selected)
int i;
int top_clear;
int row;
int height;
int context_lines;
int col;
int above_row = cmdline_row;
int redo_count = 0;
@@ -73,8 +73,7 @@ redo:
validate_cursor_col();
pum_array = NULL;
row = curwin->w_cline_row + W_WINROW(curwin);
height = curwin->w_cline_height;
row = curwin->w_wrow + W_WINROW(curwin);
if (firstwin->w_p_pvw)
top_clear = firstwin->w_height;
@@ -99,19 +98,26 @@ redo:
/* Put the pum below "row" if possible. If there are few lines decide on
* where there is more room. */
if (row >= above_row - pum_height
&& row > (above_row - top_clear - height) / 2)
if (row + 2 >= above_row - pum_height
&& row > (above_row - top_clear) / 2)
{
/* pum above "row" */
if (row >= size)
/* Leave two lines of context if possible */
if (curwin->w_wrow - curwin->w_cline_row >= 2)
context_lines = 2;
else
context_lines = curwin->w_wrow - curwin->w_cline_row;
if (row >= size + context_lines)
{
pum_row = row - size;
pum_row = row - size - context_lines;
pum_height = size;
}
else
{
pum_row = 0;
pum_height = row;
pum_height = row - context_lines;
}
if (p_ph > 0 && pum_height > p_ph)
{
@@ -122,7 +128,15 @@ redo:
else
{
/* pum below "row" */
pum_row = row + height;
/* Leave two lines of context if possible */
if (curwin->w_cline_row + curwin->w_cline_height - curwin->w_wrow >= 3)
context_lines = 3;
else
context_lines = curwin->w_cline_row
+ curwin->w_cline_height - curwin->w_wrow;
pum_row = row + context_lines;
if (size > above_row - pum_row)
pum_height = above_row - pum_row;
else