vim-patch:8.2.4609: :unhide does not check for failing to close a window (#25317)

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 vim/vim#9984)

6f2465d336

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
zeertzjq
2023-09-23 12:41:09 +08:00
committed by GitHub
parent c26b39a9aa
commit c88bb658ce
3 changed files with 27 additions and 10 deletions

View File

@@ -1341,7 +1341,6 @@ void aucmd_restbuf(aco_save_T *aco)
if (aco->use_aucmd_win_idx >= 0) {
win_T *awp = aucmd_win[aco->use_aucmd_win_idx].auc_win;
curbuf->b_nwindows--;
// Find "awp", it can't be closed, but it may be in another tab page.
// Do not trigger autocommands here.
block_autocmds();
@@ -1357,7 +1356,7 @@ void aucmd_restbuf(aco_save_T *aco)
}
}
win_found:
;
curbuf->b_nwindows--;
const bool save_stop_insert_mode = stop_insert_mode;
// May need to stop Insert mode if we were in a prompt buffer.
leaving_window(curwin);