comparison src/testdir/test_cmdline.vim @ 20717:abebcc20af26 v8.2.0911

patch 8.2.0911: crash when opening a buffer for the cmdline window fails Commit: https://github.com/vim/vim/commit/9b7cce28d568f0622d77c6c9878c2d4770c3b164 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jun 6 15:14:08 2020 +0200 patch 8.2.0911: crash when opening a buffer for the cmdline window fails Problem: Crash when opening a buffer for the cmdline window fails. (Chris Barber) Solution: Check do_ecmd() succeeds. Reset got_int if "q" was used at the more prompt. (closes #6211)
author Bram Moolenaar <Bram@vim.org>
date Sat, 06 Jun 2020 15:15:03 +0200
parents ce55e65d7e41
children 0b4a9642b39c
comparison
equal deleted inserted replaced
20716:3f0826b19029 20717:abebcc20af26
1181 " opening command window twice should fail 1181 " opening command window twice should fail
1182 call assert_beeps('call feedkeys("q:q:\<CR>\<CR>", "xt")') 1182 call assert_beeps('call feedkeys("q:q:\<CR>\<CR>", "xt")')
1183 call assert_equal(1, winnr('$')) 1183 call assert_equal(1, winnr('$'))
1184 endfunc 1184 endfunc
1185 1185
1186 func Test_cmdwin_interrupted()
1187 CheckScreendump
1188
1189 " aborting the :smile output caused the cmdline window to use the current
1190 " buffer.
1191 let lines =<< trim [SCRIPT]
1192 au WinNew * smile
1193 [SCRIPT]
1194 call writefile(lines, 'XTest_cmdwin')
1195
1196 let buf = RunVimInTerminal('-S XTest_cmdwin', {'rows': 18})
1197 call TermWait(buf, 1000)
1198 " open cmdwin
1199 call term_sendkeys(buf, "q:")
1200 call TermWait(buf, 500)
1201 " quit more prompt for :smile command
1202 call term_sendkeys(buf, "q")
1203 call TermWait(buf, 500)
1204 " execute a simple command
1205 call term_sendkeys(buf, "aecho 'done'\<CR>")
1206 call VerifyScreenDump(buf, 'Test_cmdwin_interrupted', {})
1207
1208 " clean up
1209 call StopVimInTerminal(buf)
1210 call delete('XTest_cmdwin')
1211 endfunc
1212
1186 " Test for backtick expression in the command line 1213 " Test for backtick expression in the command line
1187 func Test_cmd_backtick() 1214 func Test_cmd_backtick()
1188 %argd 1215 %argd
1189 argadd `=['a', 'b', 'c']` 1216 argadd `=['a', 'b', 'c']`
1190 call assert_equal(['a', 'b', 'c'], argv()) 1217 call assert_equal(['a', 'b', 'c'], argv())