diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-08-25 19:35:17 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-08-25 21:38:11 +0800 |
commit | 4ecea0e001533d68f3032fe0512fc55360f295c0 (patch) | |
tree | 1c1fdd54a6a2bdd7240e22cc455ab45b7db1160a /src/nvim/testdir | |
parent | 99f8d34c8a7128a9adb43168ca5364ccbd568333 (diff) | |
download | rneovim-4ecea0e001533d68f3032fe0512fc55360f295c0.tar.gz rneovim-4ecea0e001533d68f3032fe0512fc55360f295c0.tar.bz2 rneovim-4ecea0e001533d68f3032fe0512fc55360f295c0.zip |
vim-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 vim/vim#6211)
https://github.com/vim/vim/commit/9b7cce28d568f0622d77c6c9878c2d4770c3b164
Make code match latest Vim instead.
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r-- | src/nvim/testdir/test_cmdline.vim | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim index b7c6c1e4d1..e136bd7af0 100644 --- a/src/nvim/testdir/test_cmdline.vim +++ b/src/nvim/testdir/test_cmdline.vim @@ -1453,6 +1453,33 @@ func Test_cmdwin_tabpage() tabclose! endfunc +func Test_cmdwin_interrupted() + CheckScreendump + + " aborting the :smile output caused the cmdline window to use the current + " buffer. + let lines =<< trim [SCRIPT] + au WinNew * smile + [SCRIPT] + call writefile(lines, 'XTest_cmdwin') + + let buf = RunVimInTerminal('-S XTest_cmdwin', {'rows': 18}) + call TermWait(buf, 1000) + " open cmdwin + call term_sendkeys(buf, "q:") + call TermWait(buf, 500) + " quit more prompt for :smile command + call term_sendkeys(buf, "q") + call TermWait(buf, 500) + " execute a simple command + call term_sendkeys(buf, "aecho 'done'\<CR>") + call VerifyScreenDump(buf, 'Test_cmdwin_interrupted', {}) + + " clean up + call StopVimInTerminal(buf) + call delete('XTest_cmdwin') +endfunc + " Test for backtick expression in the command line func Test_cmd_backtick() CheckNotMSWindows " FIXME: see #19297 |