0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.3671: restarting Insert mode in prompt buffer too often

Problem:    Restarting Insert mode in prompt buffer too often when a callback
            switches windows and comes back. (Sean Dewar)
Solution:   Do not set "restart_edit" when already in Insert mode.
This commit is contained in:
Bram Moolenaar
2021-11-25 13:04:48 +00:00
parent 8af87bd6b1
commit 34c20ff85b
3 changed files with 30 additions and 2 deletions

View File

@@ -2268,8 +2268,9 @@ entering_window(win_T *win)
stop_insert_mode = FALSE;
// When entering the prompt window restart Insert mode if we were in Insert
// mode when we left it.
restart_edit = win->w_buffer->b_prompt_insert;
// mode when we left it and not already in Insert mode.
if ((State & INSERT) == 0)
restart_edit = win->w_buffer->b_prompt_insert;
}
#endif