@@ -29,6 +29,7 @@ static int pum_scrollbar; /* TRUE when scrollbar present */
29
29
static int pum_row ; /* top row of pum */
30
30
static int pum_col ; /* left column of pum */
31
31
32
+ static win_T * pum_window = NULL ;
32
33
static int pum_win_row ;
33
34
static int pum_win_height ;
34
35
static int pum_win_col ;
@@ -110,6 +111,7 @@ pum_display(
110
111
111
112
// Remember the essential parts of the window position and size, so we
112
113
// can decide when to reposition the popup menu.
114
+ pum_window = curwin ;
113
115
pum_win_row = curwin -> w_wrow + W_WINROW (curwin );
114
116
pum_win_height = curwin -> w_height ;
115
117
pum_win_col = curwin -> w_wincol ;
@@ -846,10 +848,11 @@ pum_may_redraw(void)
846
848
if (!pum_visible ())
847
849
return ; // nothing to do
848
850
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 ))
853
856
{
854
857
// window position didn't change, redraw in the same position
855
858
pum_redraw ();
@@ -912,6 +915,9 @@ pum_position_at_mouse(int min_width)
912
915
pum_width = Columns - pum_col ;
913
916
if (pum_width > pum_base_width + 1 )
914
917
pum_width = pum_base_width + 1 ;
918
+
919
+ // Do not redraw at cursor position.
920
+ pum_window = NULL ;
915
921
}
916
922
917
923
# endif
0 commit comments