summaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-03-22 18:13:01 +0000
committerBram Moolenaar <Bram@vim.org>2022-03-22 18:13:01 +0000
commit6f2465d336a9d4afe392db4084ef7e9db17e67c1 (patch)
tree3aaee0bf7b626607678be0c8835190a4ed695f24 /src/buffer.c
parente7dd0fa2c61fe71f12c72b0dcb7bb6415eb048fb (diff)
patch 8.2.4609: :unhide does not check for failing to close a windowv8.2.4609
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)
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 8e68d94248..2dac4874c5 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -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