vim-patch:8.2.4438: crash on exit when using cmdline window

Problem:    Crash on exit when using cmdline window.
Solution:   Reset "cmdwin_type" before exiting. (closes vim/vim#9817)
ca0c1caa36

Bram also went with the cmdwin_type = 0 solution, but putting it in
read_error_exit isn't ideal and only fixes one specific variant of the bug, so
don't port that change.

Port the test only, but skip it as Nvim does not exit after stdin is exhausted.
Using -es instead does exit, but read_error_exit does not run preserve_exit in
that case, and does not have issues exiting even without resetting cmdwin_type.

Note that the test has problems and is fixed in later patches.
This commit is contained in:
Sean Dewar 2022-02-25 00:13:25 +00:00
parent 490874f3da
commit 7519af4f0f
No known key found for this signature in database
GPG Key ID: 08CC2C83AD41B581

View File

@ -1,6 +1,7 @@
" Tests for exiting Vim.
source shared.vim
source check.vim
func Test_exiting()
let after =<< trim [CODE]
@ -109,4 +110,21 @@ func Test_exit_code()
call delete('Xtestout')
endfunc
func Test_exit_error_reading_input()
throw 'Skipped: Nvim does not exit after stdin is read'
CheckNotGui
call writefile([":au VimLeave * call writefile(['l = ' .. v:exiting], 'Xtestout')", ":tabnew\<CR>q:"], 'Xscript')
" Nvim requires "-s -" to read stdin as Normal mode input
" if RunVim([], [], '< Xscript')
if RunVim([], [], '-s - < Xscript')
call assert_equal(['l = 1'], readfile('Xtestout'))
endif
call delete('Xscript')
call delete('Xtestout')
endfun
" vim: shiftwidth=2 sts=2 expandtab