aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/autocmd.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-01-18 07:23:48 +0800
committerGitHub <noreply@github.com>2024-01-18 07:23:48 +0800
commit8a07ca6c4baf9a72476df4b1851aa33165b4f9c5 (patch)
tree1b4578d206ed6328dee89efc75b9a00be940713b /src/nvim/autocmd.c
parent780dd88b68b7a4d97c8b7ec6a8d33ab523ab04dd (diff)
downloadrneovim-8a07ca6c4baf9a72476df4b1851aa33165b4f9c5.tar.gz
rneovim-8a07ca6c4baf9a72476df4b1851aa33165b4f9c5.tar.bz2
rneovim-8a07ca6c4baf9a72476df4b1851aa33165b4f9c5.zip
vim-patch:9.1.0040: issue with prompt buffer and hidden buffer (#27071)
Problem: Modifying a hidden buffer still interferes with prompt buffer mode changes. Solution: Save and restore b_prompt_insert. (zeertzjq) closes: vim/vim#13875 Modifying hidden buffer still interferes with prompt buffer mode changes https://github.com/vim/vim/commit/f267847017976ab85117bdf75b45e769836f8d69
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 b44158c890..a385161beb 100644
--- a/src/nvim/autocmd.c
+++ b/src/nvim/autocmd.c
@@ -1302,9 +1302,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
@@ -1417,6 +1419,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