diff src/testdir/test_cmdwin.vim @ 30329:8496a2c45962 v9.0.0500

patch 9.0.0500: when quitting cmdline window with CTRL-C it remains visible Commit: https://github.com/vim/vim/commit/b2f0ca820eae50994745106d824e215d87bd7926 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Sep 18 15:08:19 2022 +0100 patch 9.0.0500: when quitting cmdline window with CTRL-C it remains visible Problem: When quitting the cmdline window with CTRL-C it remains visible. Solution: Redraw to avoid confusion. Adjust the error message. (closes #11152) Adjust the cursor position after CTRL-C.
author Bram Moolenaar <Bram@vim.org>
date Sun, 18 Sep 2022 16:15:03 +0200
parents 84ab2b07d5f8
children 6fa498af368d
line wrap: on
line diff
--- a/src/testdir/test_cmdwin.vim
+++ b/src/testdir/test_cmdwin.vim
@@ -73,7 +73,6 @@ func Test_cmdwin_restore()
   call writefile(lines, 'XTest_restore', 'D')
 
   let buf = RunVimInTerminal('-S XTest_restore', {'rows': 12})
-  call TermWait(buf, 50)
   call term_sendkeys(buf, "q:")
   call VerifyScreenDump(buf, 'Test_cmdwin_restore_1', {})
 
@@ -93,11 +92,9 @@ func Test_cmdwin_restore()
 endfunc
 
 func Test_cmdwin_no_terminal()
-  CheckFeature terminal
-  CheckNotMSWindows
+  CheckScreendump
 
   let buf = RunVimInTerminal('', {'rows': 12})
-  call TermWait(buf, 50)
   call term_sendkeys(buf, ":set cmdheight=2\<CR>")
   call term_sendkeys(buf, "q:")
   call term_sendkeys(buf, ":let buf = term_start(['/bin/echo'], #{hidden: 1})\<CR>")
@@ -106,6 +103,22 @@ func Test_cmdwin_no_terminal()
   call StopVimInTerminal(buf)
 endfunc
 
+func Test_cmdwin_wrong_command()
+  CheckScreendump
+
+  let buf = RunVimInTerminal('', {'rows': 12})
+  call term_sendkeys(buf, "q:")
+  call term_sendkeys(buf, "als\<Esc>")
+  call term_sendkeys(buf, "\<C-W>k")
+  call VerifyScreenDump(buf, 'Test_cmdwin_wrong_command_1', {})
+
+  call term_sendkeys(buf, "\<C-C>")
+  call VerifyScreenDump(buf, 'Test_cmdwin_wrong_command_2', {})
+
+  call term_sendkeys(buf, ":q\<CR>")
+  call StopVimInTerminal(buf)
+endfunc
+
 func Test_cmdwin_feedkeys()
   " This should not generate E488
   call feedkeys("q:\<CR>", 'x')