aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/autocmd.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-09-23 12:41:09 +0800
committerGitHub <noreply@github.com>2023-09-23 12:41:09 +0800
commitc88bb658ce6fb12cca3e5324d8a15d1859d095cd (patch)
tree1134e21022f84669b526d73f1b4a1479b8bad762 /src/nvim/autocmd.c
parentc26b39a9aa56e834262753e08372240fde9dcdf1 (diff)
downloadrneovim-c88bb658ce6fb12cca3e5324d8a15d1859d095cd.tar.gz
rneovim-c88bb658ce6fb12cca3e5324d8a15d1859d095cd.tar.bz2
rneovim-c88bb658ce6fb12cca3e5324d8a15d1859d095cd.zip
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) https://github.com/vim/vim/commit/6f2465d336a9d4afe392db4084ef7e9db17e67c1 Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/autocmd.c')
-rw-r--r--src/nvim/autocmd.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/nvim/autocmd.c b/src/nvim/autocmd.c
index 3fa20f4e48..ff0c2f063f 100644
--- a/src/nvim/autocmd.c
+++ b/src/nvim/autocmd.c
@@ -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);