File tree 4 files changed +35
-0
lines changed
4 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ static int pum_selected; // index of selected item or -1
18
18
static int pum_first = 0 ; // index of top item
19
19
20
20
static int call_update_screen = FALSE;
21
+ static int pum_in_cmdline = FALSE;
21
22
22
23
static int pum_height ; // nr of displayed pum items
23
24
static int pum_width ; // width of displayed pum items
@@ -1067,6 +1068,11 @@ pum_undisplay(void)
1067
1068
pum_array = NULL ;
1068
1069
redraw_all_later (UPD_NOT_VALID );
1069
1070
redraw_tabline = TRUE;
1071
+ if (pum_in_cmdline )
1072
+ {
1073
+ clear_cmdline = TRUE;
1074
+ pum_in_cmdline = FALSE;
1075
+ }
1070
1076
status_redraw_all ();
1071
1077
#if defined(FEAT_PROP_POPUP ) && defined(FEAT_QUICKFIX )
1072
1078
// hide any popup info window
@@ -1193,6 +1199,8 @@ pum_position_at_mouse(int min_width)
1193
1199
pum_row = mouse_row + 1 ;
1194
1200
if (pum_height > Rows - pum_row )
1195
1201
pum_height = Rows - pum_row ;
1202
+ if (pum_row + pum_height > cmdline_row )
1203
+ pum_in_cmdline = TRUE;
1196
1204
}
1197
1205
else
1198
1206
{
Original file line number Diff line number Diff line change
1
+ >a+0&#ffffff0|b|c|d|e| @69
2
+ |a|b|c|d|e| @69
3
+ |a|b|c|d|e| @69
4
+ @57|1|,|1| @10|T|o|p|
Original file line number Diff line number Diff line change @@ -594,4 +594,25 @@ func Test_unmenu_while_listing_menus()
594
594
call StopVimInTerminal (buf )
595
595
endfunc
596
596
597
+ " Test for opening a menu drawn in the cmdline area
598
+ func Test_popupmenu_cmdline ()
599
+ CheckRunVimInTerminal
600
+
601
+ let lines = << trim END
602
+ set mousemodel = popup
603
+ menu PopUp.Test1 :<CR>
604
+ menu PopUp.Test2 :<CR>
605
+ menu PopUp.Test3 :<CR>
606
+ call setline (1 , repeat ([' abcde' ], 5 ))
607
+ END
608
+ call writefile (lines , ' Xpopupcmdline' , ' D' )
609
+ let buf = RunVimInTerminal (' -S Xpopupcmdline' , {' rows' : 4 })
610
+
611
+ " cmdline area should be cleared when popupmenu that covered it is closed
612
+ call term_sendkeys (buf , " \<RightMouse>\<RightRelease>\<Esc> " )
613
+ call VerifyScreenDump (buf , ' Test_popupmenu_cmdline_1' , {})
614
+
615
+ call StopVimInTerminal (buf )
616
+ endfunc
617
+
597
618
" vim: shiftwidth = 2 sts = 2 expandtab
Original file line number Diff line number Diff line change @@ -695,6 +695,8 @@ static char *(features[]) =
695
695
696
696
static int included_patches [] =
697
697
{ /* Add new patch number below this line */
698
+ /**/
699
+ 1480 ,
698
700
/**/
699
701
1479 ,
700
702
/**/
You can’t perform that action at this time.
0 commit comments