aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/autocmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/autocmd.c')
-rw-r--r--src/nvim/autocmd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nvim/autocmd.c b/src/nvim/autocmd.c
index 578542adfe..9b4cb336bc 100644
--- a/src/nvim/autocmd.c
+++ b/src/nvim/autocmd.c
@@ -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) {