summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_menu.vim
diff options
context:
space:
mode:
authorLuuk van Baal <luukvbaal@gmail.com>2023-04-23 16:24:08 +0100
committerBram Moolenaar <Bram@vim.org>2023-04-23 16:24:08 +0100
commitdcd40cfca0fe0e65d405ce9711745a8ec846c30c (patch)
treed27637dc3d150255a81d954c9f684c7d34766c10 /src/testdir/test_menu.vim
parentf39d9e9dca443e42920066be3a98fd9780e4ed33 (diff)
patch 9.0.1480: using popup menu may leave text in the command linev9.0.1480
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)
Diffstat (limited to 'src/testdir/test_menu.vim')
-rw-r--r--src/testdir/test_menu.vim21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/testdir/test_menu.vim b/src/testdir/test_menu.vim
index 9929dd5e74..22292289ee 100644
--- a/src/testdir/test_menu.vim
+++ b/src/testdir/test_menu.vim
@@ -594,4 +594,25 @@ func Test_unmenu_while_listing_menus()
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