aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/autocmd.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-04-03 08:36:14 +0800
committerGitHub <noreply@github.com>2023-04-03 08:36:14 +0800
commit10baf89712724b4b95f7c641f2012f051737003c (patch)
treeeec22a0282d1c291ea54d3d0d4a7dd1feb2b91c9 /src/nvim/autocmd.c
parent53f36806f1b5107c0570ffbf57180a8e08f45b2e (diff)
downloadrneovim-10baf89712724b4b95f7c641f2012f051737003c.tar.gz
rneovim-10baf89712724b4b95f7c641f2012f051737003c.tar.bz2
rneovim-10baf89712724b4b95f7c641f2012f051737003c.zip
vim-patch:9.0.1439: start Insert mode when accessing a hidden prompt buffer (#22867)
Problem: Start Insert mode when accessing a hidden prompt buffer. Solution: Call leaving_window() in aucmd_restbuf(). (Thorben Tröbst, closes vim/vim#12148, closes vim/vim#12147) https://github.com/vim/vim/commit/cde8de034524d00aba4ff4142e658baff511e12d Cherry-pick test_prompt_buffer.vim changes from patch 9.0.0631. Co-authored-by: orbital <orbital@holgerines.de>
Diffstat (limited to 'src/nvim/autocmd.c')
-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 578542adfe..9b4cb336bc 100644
--- a/src/nvim/autocmd.c
+++ b/src/nvim/autocmd.c
@@ -1495,7 +1495,9 @@ void aucmd_restbuf(aco_save_T *aco)
}
}
win_found:
-
+ // May need to stop Insert mode if we were in a prompt buffer.
+ leaving_window(curwin);
+ // Remove the window.
win_remove(curwin, NULL);
pmap_del(handle_T)(&window_handles, curwin->handle);
if (curwin->w_grid_alloc.chars != NULL) {