@@ -29,6 +29,7 @@ static int pum_scrollbar; /* TRUE when scrollbar present */
2929static int pum_row ; /* top row of pum */
3030static int pum_col ; /* left column of pum */
3131
32+ static win_T * pum_window = NULL ;
3233static int pum_win_row ;
3334static int pum_win_height ;
3435static 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
0 commit comments