static int pum_first = 0; // index of top item
static int call_update_screen = FALSE;
+static int pum_in_cmdline = FALSE;
static int pum_height; // nr of displayed pum items
static int pum_width; // width of displayed pum items
pum_array = NULL;
redraw_all_later(UPD_NOT_VALID);
redraw_tabline = TRUE;
+ if (pum_in_cmdline)
+ {
+ clear_cmdline = TRUE;
+ pum_in_cmdline = FALSE;
+ }
status_redraw_all();
#if defined(FEAT_PROP_POPUP) && defined(FEAT_QUICKFIX)
// hide any popup info window
pum_row = mouse_row + 1;
if (pum_height > Rows - pum_row)
pum_height = Rows - pum_row;
+ if (pum_row + pum_height > cmdline_row)
+ pum_in_cmdline = TRUE;
}
else
{
call StopVimInTerminal(buf)
endfunc
+" Test for opening a menu drawn in the cmdline area
+func Test_popupmenu_cmdline()
+ CheckRunVimInTerminal
+
+ let lines =<< trim END
+ set mousemodel=popup
+ menu PopUp.Test1 :<CR>
+ menu PopUp.Test2 :<CR>
+ menu PopUp.Test3 :<CR>
+ call setline(1, repeat(['abcde'], 5))
+ END
+ call writefile(lines, 'Xpopupcmdline', 'D')
+ let buf = RunVimInTerminal('-S Xpopupcmdline', {'rows': 4})
+
+ " cmdline area should be cleared when popupmenu that covered it is closed
+ call term_sendkeys(buf, "\<RightMouse>\<RightRelease>\<Esc>")
+ call VerifyScreenDump(buf, 'Test_popupmenu_cmdline_1', {})
+
+ call StopVimInTerminal(buf)
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab