vim-patch:9.2.0882: :bwipe crashes if WinLeave wipes all other buffers (#41082)

Problem:  :bwipe crashes if WinLeave wipes all other buffers
          (after 9.1.2068).
Solution: Check for NULL pointer.

related: neovim/neovim#41066
closes: vim/vim#20888

3e4019a082
This commit is contained in:
zeertzjq
2026-08-01 07:25:28 +08:00
committed by GitHub
parent 4836ecad1f
commit f8872bccbe
2 changed files with 8 additions and 1 deletions

View File

@@ -937,6 +937,13 @@ func Test_split_window_in_BufLeave_from_switching_buffer()
bwipe! Xb
endfunc
func Test_wipe_other_buffers_in_WinLeave_from_bwipe()
tabnew
autocmd WinLeave * ++once 1,$-1bwipe!
" This should not crash
$bwipe!
endfunc
" Switch to a buffer whose name contains '%' via completion (#20529).
func Test_buffer_switch_to_name_with_percent()
CheckMSWindows