diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-11-25 13:04:48 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-11-25 13:04:48 +0000 |
commit | 34c20ff85b87be587ea5d0398812441b502ee6a5 (patch) | |
tree | 6e4c613ac850ce65d15e3ad306694474fb4fb824 /src/window.c | |
parent | 8af87bd6b1808ffcafdd73b1d7501dd50b9d15bc (diff) | |
download | vim-git-34c20ff85b87be587ea5d0398812441b502ee6a5.tar.gz |
patch 8.2.3671: restarting Insert mode in prompt buffer too oftenv8.2.3671
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.
Diffstat (limited to 'src/window.c')
-rw-r--r-- | src/window.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/window.c b/src/window.c index d28962a30..4fbf94428 100644 --- a/src/window.c +++ b/src/window.c @@ -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 |