diff options
author | Bram Moolenaar <Bram@vim.org> | 2023-04-09 22:01:31 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-04-09 22:01:31 +0100 |
commit | 05a627c3d4e42a18f76c14828d68ee4747118211 (patch) | |
tree | 3178407812dcd3bdfb57ec78ce5eaffabf3a9eb3 /src/autocmd.c | |
parent | bfc7cbd1d44e53e844a079d8ad16ae990dad664d (diff) |
patch 9.0.1443: ending Insert mode when accessing a hidden prompt bufferv9.0.1443
Problem: Ending Insert mode when accessing a hidden prompt buffer.
Solution: Don't stop Insert mode when it was active before. (closes #12237)
Diffstat (limited to 'src/autocmd.c')
-rw-r--r-- | src/autocmd.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/autocmd.c b/src/autocmd.c index e5f512503a..6460fcdc64 100644 --- a/src/autocmd.c +++ b/src/autocmd.c @@ -1566,6 +1566,8 @@ 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; + if (win != NULL) { // There is a window for "buf" in the current tab page, make it the @@ -1660,6 +1662,9 @@ win_found: #ifdef FEAT_JOB_CHANNEL // 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; #endif // Remove the window and frame from the tree of frames. (void)winframe_remove(curwin, &dummy, NULL); |