vim-patch:9.1.2095: :wqall! doesn't quit when using :quit in BufWritePost

Problem:  :wqall! doesn't quit when using :quit in BufWritePost
          (after 8.0.1190).
Solution: Restore old value of "exiting" when calling not_exiting()
          instead of always resetting it to FALSE (zeertzjq).

related: vim/vim#2205
closes:  vim/vim#19212

e803ad1c56
This commit is contained in:
zeertzjq
2026-01-20 06:24:22 +08:00
parent 933b99a2b1
commit b4e602dde5
3 changed files with 28 additions and 11 deletions

View File

@@ -93,6 +93,20 @@ func Test_exiting()
call assert_equal(['QuitPre', 'ExitPre'], readfile('Xtestout'))
endif
call delete('Xtestout')
" Test using :quit in BufWritePost during :wqall
let after =<< trim [CODE]
botright new Xwritebuf
call setline(1, 'SHOULD BE WRITTEN')
autocmd BufWritePost Xwritebuf 1quit
wqall
call setline(1, 'NOT REACHED') | write | qall
[CODE]
if RunVim([], after, '')
call assert_equal(['SHOULD BE WRITTEN'], readfile('Xwritebuf'))
endif
call delete('Xwritebuf')
endfunc
" Test for getting the Vim exit code from v:exiting