Skip to content

Commit 0e6e179

Browse files
committed
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.
1 parent 942b454 commit 0e6e179

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/popupmnu.c

+10-4
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ static int pum_scrollbar; /* TRUE when scrollbar present */
2929
static int pum_row; /* top row of pum */
3030
static int pum_col; /* left column of pum */
3131

32+
static win_T *pum_window = NULL;
3233
static int pum_win_row;
3334
static int pum_win_height;
3435
static int pum_win_col;
@@ -110,6 +111,7 @@ pum_display(
110111

111112
// Remember the essential parts of the window position and size, so we
112113
// can decide when to reposition the popup menu.
114+
pum_window = curwin;
113115
pum_win_row = curwin->w_wrow + W_WINROW(curwin);
114116
pum_win_height = curwin->w_height;
115117
pum_win_col = curwin->w_wincol;
@@ -846,10 +848,11 @@ pum_may_redraw(void)
846848
if (!pum_visible())
847849
return; // nothing to do
848850

849-
if (pum_win_row == curwin->w_wrow + W_WINROW(curwin)
850-
&& pum_win_height == curwin->w_height
851-
&& pum_win_col == curwin->w_wincol
852-
&& pum_win_width == curwin->w_width)
851+
if (pum_window != curwin
852+
|| (pum_win_row == curwin->w_wrow + W_WINROW(curwin)
853+
&& pum_win_height == curwin->w_height
854+
&& pum_win_col == curwin->w_wincol
855+
&& pum_win_width == curwin->w_width))
853856
{
854857
// window position didn't change, redraw in the same position
855858
pum_redraw();
@@ -912,6 +915,9 @@ pum_position_at_mouse(int min_width)
912915
pum_width = Columns - pum_col;
913916
if (pum_width > pum_base_width + 1)
914917
pum_width = pum_base_width + 1;
918+
919+
// Do not redraw at cursor position.
920+
pum_window = NULL;
915921
}
916922

917923
# endif

src/version.c

+2
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,8 @@ static char *(features[]) =
761761

762762
static int included_patches[] =
763763
{ /* Add new patch number below this line */
764+
/**/
765+
65,
764766
/**/
765767
64,
766768
/**/

0 commit comments

Comments
 (0)