summaryrefslogtreecommitdiffstatshomepage
path: root/src/nvim/autocmd.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-01-19 12:10:31 +0800
committerGitHub <noreply@github.com>2024-01-19 12:10:31 +0800
commit0ef27180e31671a043b28547da327cd52f1a87c4 (patch)
treec27d0a5ab971cc09c1b52400027654488016301f /src/nvim/autocmd.c
parentf58c6135084f75e6250fd6b11eac410fb9a21b7a (diff)
parent26f836586479239935115944bff1dd2d156ef569 (diff)
Merge pull request #27088 from zeertzjq/backportrelease-0.9
Backport to release-0.9
Diffstat (limited to 'src/nvim/autocmd.c')
-rw-r--r--src/nvim/autocmd.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/nvim/autocmd.c b/src/nvim/autocmd.c
index 5f6bcf14fd..9dd1de04e4 100644
--- a/src/nvim/autocmd.c
+++ b/src/nvim/autocmd.c
@@ -1432,9 +1432,11 @@ void aucmd_prepbuf(aco_save_T *aco, buf_T *buf)
}
aco->save_curwin_handle = curwin->handle;
- aco->save_curbuf = curbuf;
aco->save_prevwin_handle = prevwin == NULL ? 0 : prevwin->handle;
aco->save_State = State;
+ if (bt_prompt(curbuf)) {
+ aco->save_prompt_insert = curbuf->b_prompt_insert;
+ }
if (win != NULL) {
// There is a window for "buf" in the current tab page, make it the
@@ -1547,6 +1549,9 @@ win_found:
curbuf = curwin->w_buffer;
// May need to restore insert mode for a prompt buffer.
entering_window(curwin);
+ if (bt_prompt(curbuf)) {
+ curbuf->b_prompt_insert = aco->save_prompt_insert;
+ }
prevwin = win_find_by_handle(aco->save_prevwin_handle);
vars_clear(&awp->w_vars->dv_hashtab); // free all w: variables