aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-05-27 22:15:22 +0800
committerGitHub <noreply@github.com>2023-05-27 22:15:22 +0800
commitb46f61ac050e6eb530ceb4d4b510b612596427c5 (patch)
tree1bb67bdd0832024497d24d52c586b8461dd5a53e /src
parent510e1f131b56e0423342f597178459a63eb0b810 (diff)
downloadrneovim-b46f61ac050e6eb530ceb4d4b510b612596427c5.tar.gz
rneovim-b46f61ac050e6eb530ceb4d4b510b612596427c5.tar.bz2
rneovim-b46f61ac050e6eb530ceb4d4b510b612596427c5.zip
vim-patch:9.0.1582: :stopinsert may not work in a popup close handler (#23785)
Problem: :stopinsert may not work in a popup close handler. (Ben Jackson) Solution: Restore stop_insert_mode when appropriate. (closes vim/vim#12452, closes vim/vim#12434) https://github.com/vim/vim/commit/a40c0bcc83c32da02869f59b10538d6327df61c5
Diffstat (limited to 'src')
-rw-r--r--src/nvim/autocmd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nvim/autocmd.c b/src/nvim/autocmd.c
index 17a3fd33f1..53cca7baa1 100644
--- a/src/nvim/autocmd.c
+++ b/src/nvim/autocmd.c
@@ -1355,11 +1355,13 @@ void aucmd_restbuf(aco_save_T *aco)
}
}
win_found:
+ ;
+ 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);
// Do not stop Insert mode when already in Insert mode before.
if (aco->save_State & MODE_INSERT) {
- stop_insert_mode = false;
+ stop_insert_mode = save_stop_insert_mode;
}
// Remove the window.
win_remove(curwin, NULL);