patch 9.0.1480: using popup menu may leave text in the command line
Problem: Using popup menu may leave text in the command line.
Solution: Clear the command line if the popup menu covered it. (Luuk van
Baal, closes #12286)
diff --git a/src/testdir/dumps/Test_popupmenu_cmdline_1.dump b/src/testdir/dumps/Test_popupmenu_cmdline_1.dump
new file mode 100644
index 0000000..2ffcc46
--- /dev/null
+++ b/src/testdir/dumps/Test_popupmenu_cmdline_1.dump
@@ -0,0 +1,4 @@
+>a+0&#ffffff0|b|c|d|e| @69
+|a|b|c|d|e| @69
+|a|b|c|d|e| @69
+@57|1|,|1| @10|T|o|p|
diff --git a/src/testdir/test_menu.vim b/src/testdir/test_menu.vim
index 9929dd5..2229228 100644
--- a/src/testdir/test_menu.vim
+++ b/src/testdir/test_menu.vim
@@ -594,4 +594,25 @@
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