mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
updated for version 7.4a.042
Problem: Crash when BufUnload autocommands close all buffers. (Andrew Pimlott) Solution: Set curwin->w_buffer to curbuf to avoid NULL.
This commit is contained in:
@@ -2291,8 +2291,13 @@ win_close(win, free_buf)
|
||||
if (only_one_window() && win_valid(win) && win->w_buffer == NULL
|
||||
&& (last_window() || curtab != prev_curtab
|
||||
|| close_last_window_tabpage(win, free_buf, prev_curtab)))
|
||||
/* Autocommands have close all windows, quit now. */
|
||||
{
|
||||
/* Autocommands have close all windows, quit now. Restore
|
||||
* curwin->w_buffer, otherwise writing viminfo may fail. */
|
||||
if (curwin->w_buffer == NULL)
|
||||
curwin->w_buffer = curbuf;
|
||||
getout(0);
|
||||
}
|
||||
|
||||
/* Autocommands may have closed the window already, or closed the only
|
||||
* other window or moved to another tab page. */
|
||||
|
Reference in New Issue
Block a user