From 08e193633b768f610df9adc7856b3aacf98ede54 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 24 Jan 2026 09:28:48 +0800 Subject: [PATCH] vim-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 vim/vim#12286) https://github.com/vim/vim/commit/dcd40cfca0fe0e65d405ce9711745a8ec846c30c No code change is need in Nvim and testing is already covered by test/functional/ui/popupmenu_spec.lua. Co-authored-by: Luuk van Baal --- test/old/testdir/test_menu.vim | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/old/testdir/test_menu.vim b/test/old/testdir/test_menu.vim index 0a8c6e69c0..2b09240c80 100644 --- a/test/old/testdir/test_menu.vim +++ b/test/old/testdir/test_menu.vim @@ -638,4 +638,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 : + menu PopUp.Test2 : + menu PopUp.Test3 : + 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, "\\\") + call VerifyScreenDump(buf, 'Test_popupmenu_cmdline_1', {}) + + call StopVimInTerminal(buf) +endfunc + " vim: shiftwidth=2 sts=2 expandtab