diff src/testdir/test_cmdline.vim @ 28427:96d53065f309 v8.2.4738

patch 8.2.4738: Esc on commandline executes command instead of abandoning it Commit: https://github.com/vim/vim/commit/11a57dfd16a47f248fe949344bd5db3f12b9bd32 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Apr 11 19:38:56 2022 +0100 patch 8.2.4738: Esc on commandline executes command instead of abandoning it Problem: Esc on commandline executes command instead of abandoning it. Solution: Save and restore KeyTyped when removing the popup menu. (closes #10154)
author Bram Moolenaar <Bram@vim.org>
date Mon, 11 Apr 2022 20:45:02 +0200
parents d32dc906dd2c
children 80085afc2f4d
line wrap: on
line diff
--- a/src/testdir/test_cmdline.vim
+++ b/src/testdir/test_cmdline.vim
@@ -2510,6 +2510,29 @@ func Test_wildmenumode_with_pum()
   cunmap <F2>
 endfunc
 
+func Test_wildmenu_with_pum_foldexpr()
+  CheckRunVimInTerminal
+
+  let lines =<< trim END
+      call setline(1, ['folded one', 'folded two', 'some more text'])
+      func MyFoldText()
+        return 'foo'
+      endfunc
+      set foldtext=MyFoldText() wildoptions=pum
+      normal ggzfj
+  END
+  call writefile(lines, 'Xpumfold')
+  let buf = RunVimInTerminal('-S Xpumfold', #{rows: 10})
+  call term_sendkeys(buf, ":set\<Tab>")
+  call VerifyScreenDump(buf, 'Test_wildmenu_with_pum_foldexpr_1', {})
+
+  call term_sendkeys(buf, "\<Esc>")
+  call VerifyScreenDump(buf, 'Test_wildmenu_with_pum_foldexpr_2', {})
+
+  call StopVimInTerminal(buf)
+  call delete('Xpumfold')
+endfunc
+
 " Test for opening the cmdline completion popup menu from the terminal window.
 " The popup menu should be positioned correctly over the status line of the
 " bottom-most window.