Problem: :bwipe crashes if WinLeave wipes all other buffers
(after 9.1.2068).
Solution: Check for NULL pointer.
related: neovim/neovim#41066
closes: #20888
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
buf = curbuf->b_next;
else
buf = 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;
}
}
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
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 882,
/**/
881,
/**/