mirror of
https://github.com/vim/vim.git
synced 2025-09-26 04:04:07 -04:00
patch 8.1.0065: balloon displayed at the wrong position
Problem: Balloon displayed at the wrong position. Solution: Do not reposition the popup menu at the cursor position.
This commit is contained in:
@@ -29,6 +29,7 @@ static int pum_scrollbar; /* TRUE when scrollbar present */
|
|||||||
static int pum_row; /* top row of pum */
|
static int pum_row; /* top row of pum */
|
||||||
static int pum_col; /* left column of pum */
|
static int pum_col; /* left column of pum */
|
||||||
|
|
||||||
|
static win_T *pum_window = NULL;
|
||||||
static int pum_win_row;
|
static int pum_win_row;
|
||||||
static int pum_win_height;
|
static int pum_win_height;
|
||||||
static int pum_win_col;
|
static int pum_win_col;
|
||||||
@@ -110,6 +111,7 @@ pum_display(
|
|||||||
|
|
||||||
// Remember the essential parts of the window position and size, so we
|
// Remember the essential parts of the window position and size, so we
|
||||||
// can decide when to reposition the popup menu.
|
// can decide when to reposition the popup menu.
|
||||||
|
pum_window = curwin;
|
||||||
pum_win_row = curwin->w_wrow + W_WINROW(curwin);
|
pum_win_row = curwin->w_wrow + W_WINROW(curwin);
|
||||||
pum_win_height = curwin->w_height;
|
pum_win_height = curwin->w_height;
|
||||||
pum_win_col = curwin->w_wincol;
|
pum_win_col = curwin->w_wincol;
|
||||||
@@ -846,10 +848,11 @@ pum_may_redraw(void)
|
|||||||
if (!pum_visible())
|
if (!pum_visible())
|
||||||
return; // nothing to do
|
return; // nothing to do
|
||||||
|
|
||||||
if (pum_win_row == curwin->w_wrow + W_WINROW(curwin)
|
if (pum_window != curwin
|
||||||
&& pum_win_height == curwin->w_height
|
|| (pum_win_row == curwin->w_wrow + W_WINROW(curwin)
|
||||||
&& pum_win_col == curwin->w_wincol
|
&& pum_win_height == curwin->w_height
|
||||||
&& pum_win_width == curwin->w_width)
|
&& pum_win_col == curwin->w_wincol
|
||||||
|
&& pum_win_width == curwin->w_width))
|
||||||
{
|
{
|
||||||
// window position didn't change, redraw in the same position
|
// window position didn't change, redraw in the same position
|
||||||
pum_redraw();
|
pum_redraw();
|
||||||
@@ -912,6 +915,9 @@ pum_position_at_mouse(int min_width)
|
|||||||
pum_width = Columns - pum_col;
|
pum_width = Columns - pum_col;
|
||||||
if (pum_width > pum_base_width + 1)
|
if (pum_width > pum_base_width + 1)
|
||||||
pum_width = pum_base_width + 1;
|
pum_width = pum_base_width + 1;
|
||||||
|
|
||||||
|
// Do not redraw at cursor position.
|
||||||
|
pum_window = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
# endif
|
# endif
|
||||||
|
@@ -761,6 +761,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
65,
|
||||||
/**/
|
/**/
|
||||||
64,
|
64,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user