mirror of
https://github.com/neovim/neovim.git
synced 2026-08-02 21:59:11 +00:00
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:
@@ -1626,7 +1626,7 @@ static int do_buffer_ext(int action, int start, int dir, int count, int flags)
|
||||
}
|
||||
if (buf == NULL) { // Still no buffer, just take one
|
||||
buf = curbuf->b_next != NULL ? curbuf->b_next : curbuf->b_prev;
|
||||
if (bt_quickfix(buf) || (buf != curbuf && buf->b_locked_split)) {
|
||||
if (bt_quickfix(buf) || (buf != NULL && buf != curbuf && buf->b_locked_split)) {
|
||||
buf = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user