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)

cde8de0345

Cherry-pick test_prompt_buffer.vim changes from patch 9.0.0631.

Co-authored-by: orbital <orbital@holgerines.de>
This commit is contained in:
zeertzjq
2023-04-03 08:36:14 +08:00
committed by GitHub
parent 53f36806f1
commit 10baf89712
4 changed files with 84 additions and 8 deletions

View File

@@ -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) {