comparison 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
comparison
equal deleted inserted replaced
30328:60f24e323057 30329:8496a2c45962
71 2split 71 2split
72 [SCRIPT] 72 [SCRIPT]
73 call writefile(lines, 'XTest_restore', 'D') 73 call writefile(lines, 'XTest_restore', 'D')
74 74
75 let buf = RunVimInTerminal('-S XTest_restore', {'rows': 12}) 75 let buf = RunVimInTerminal('-S XTest_restore', {'rows': 12})
76 call TermWait(buf, 50)
77 call term_sendkeys(buf, "q:") 76 call term_sendkeys(buf, "q:")
78 call VerifyScreenDump(buf, 'Test_cmdwin_restore_1', {}) 77 call VerifyScreenDump(buf, 'Test_cmdwin_restore_1', {})
79 78
80 " normal restore 79 " normal restore
81 call term_sendkeys(buf, ":q\<CR>") 80 call term_sendkeys(buf, ":q\<CR>")
91 " clean up 90 " clean up
92 call StopVimInTerminal(buf) 91 call StopVimInTerminal(buf)
93 endfunc 92 endfunc
94 93
95 func Test_cmdwin_no_terminal() 94 func Test_cmdwin_no_terminal()
96 CheckFeature terminal 95 CheckScreendump
97 CheckNotMSWindows
98 96
99 let buf = RunVimInTerminal('', {'rows': 12}) 97 let buf = RunVimInTerminal('', {'rows': 12})
100 call TermWait(buf, 50)
101 call term_sendkeys(buf, ":set cmdheight=2\<CR>") 98 call term_sendkeys(buf, ":set cmdheight=2\<CR>")
102 call term_sendkeys(buf, "q:") 99 call term_sendkeys(buf, "q:")
103 call term_sendkeys(buf, ":let buf = term_start(['/bin/echo'], #{hidden: 1})\<CR>") 100 call term_sendkeys(buf, ":let buf = term_start(['/bin/echo'], #{hidden: 1})\<CR>")
104 call VerifyScreenDump(buf, 'Test_cmdwin_no_terminal', {}) 101 call VerifyScreenDump(buf, 'Test_cmdwin_no_terminal', {})
102 call term_sendkeys(buf, ":q\<CR>")
103 call StopVimInTerminal(buf)
104 endfunc
105
106 func Test_cmdwin_wrong_command()
107 CheckScreendump
108
109 let buf = RunVimInTerminal('', {'rows': 12})
110 call term_sendkeys(buf, "q:")
111 call term_sendkeys(buf, "als\<Esc>")
112 call term_sendkeys(buf, "\<C-W>k")
113 call VerifyScreenDump(buf, 'Test_cmdwin_wrong_command_1', {})
114
115 call term_sendkeys(buf, "\<C-C>")
116 call VerifyScreenDump(buf, 'Test_cmdwin_wrong_command_2', {})
117
105 call term_sendkeys(buf, ":q\<CR>") 118 call term_sendkeys(buf, ":q\<CR>")
106 call StopVimInTerminal(buf) 119 call StopVimInTerminal(buf)
107 endfunc 120 endfunc
108 121
109 func Test_cmdwin_feedkeys() 122 func Test_cmdwin_feedkeys()