diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-01-17 21:22:59 +0100 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2024-01-17 21:22:59 +0100 |
commit | f267847017976ab85117bdf75b45e769836f8d69 (patch) | |
tree | d57462af4d3a29cb32ebd31e714a7a6de56c40eb /src/autocmd.c | |
parent | 6a8d2e1634f8f0d7463a2786dbcbe0f38dd287a7 (diff) |
patch 9.1.0040: issue with prompt buffer and hidden bufferv9.1.0040
Problem: Modifying a hidden buffer still interferes with prompt buffer
mode changes.
Solution: Save and restore b_prompt_insert.
(zeertzjq)
closes: #13875
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Modifying hidden buffer still interferes with prompt buffer mode changes
Diffstat (limited to 'src/autocmd.c')
-rw-r--r-- | src/autocmd.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/autocmd.c b/src/autocmd.c index 8b8f109ea0..80ce8ca6c8 100644 --- a/src/autocmd.c +++ b/src/autocmd.c @@ -1565,9 +1565,12 @@ aucmd_prepbuf( } aco->save_curwin_id = curwin->w_id; - aco->save_curbuf = curbuf; aco->save_prevwin_id = prevwin == NULL ? 0 : prevwin->w_id; aco->save_State = State; +#ifdef FEAT_JOB_CHANNEL + if (bt_prompt(curbuf)) + aco->save_prompt_insert = curbuf->b_prompt_insert; +#endif if (win != NULL) { @@ -1692,6 +1695,8 @@ win_found: #ifdef FEAT_JOB_CHANNEL // 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; #endif prevwin = win_find_by_id(aco->save_prevwin_id); #ifdef FEAT_EVAL |