0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.2.4609: :unhide does not check for failing to close a window

Problem:    :unhide does not check for failing to close a window.
Solution:   When closing a window fails continue with the next one.  Do not
            try closing the autocmd window. (closes #9984)
This commit is contained in:
Bram Moolenaar
2022-03-22 18:13:01 +00:00
parent e7dd0fa2c6
commit 6f2465d336
5 changed files with 33 additions and 12 deletions

View File

@@ -5330,17 +5330,21 @@ ex_buffer_all(exarg_T *eap)
{
wpnext = wp->w_next;
if ((wp->w_buffer->b_nwindows > 1
|| ((cmdmod.cmod_split & WSP_VERT)
? wp->w_height + wp->w_status_height < Rows - p_ch
- tabline_height()
: wp->w_width != Columns)
|| (had_tab > 0 && wp != firstwin)) && !ONE_WINDOW
&& !(wp->w_closing || wp->w_buffer->b_locked > 0))
|| ((cmdmod.cmod_split & WSP_VERT)
? wp->w_height + wp->w_status_height < Rows - p_ch
- tabline_height()
: wp->w_width != Columns)
|| (had_tab > 0 && wp != firstwin))
&& !ONE_WINDOW
&& !(wp->w_closing || wp->w_buffer->b_locked > 0)
&& !win_unlisted(wp))
{
win_close(wp, FALSE);
wpnext = firstwin; // just in case an autocommand does
// something strange with windows
tpnext = first_tabpage; // start all over...
if (win_close(wp, FALSE) == FAIL)
break;
// Just in case an autocommand does something strange with
// windows: start all over...
wpnext = firstwin;
tpnext = first_tabpage;
open_wins = 0;
}
else