vim-patch:8.1.0064: typing CTRL-W in a prompt buffer shows mode "-- --"

Problem:    Typing CTRL-W in a prompt buffer shows mode "-- --".
Solution:   Set restart_edit to 'A' and check for it.
942b4541a2

Nvim already checked for 'i' in showmode(), so this bug was fixed with <C-W>
(though this patch now changes <C-W> to use 'A').

However, the missing changes I ported for v8.1.0036 use 'A' when a callback
leaves the window in insert mode and edit gets restarted, so this bug was
possible there.

Modify showmode() restart_edit condition to match v8.2.1978:
957cf67d50
This commit is contained in:
Sean Dewar
2021-11-07 20:57:09 +00:00
parent b9ab4c1dea
commit 1fffccc5d6
3 changed files with 6 additions and 3 deletions

View File

@@ -2240,6 +2240,9 @@ static void leaving_window(win_T *const win)
// When leaving a prompt window stop Insert mode and perhaps restart
// it when entering that window again.
win->w_buffer->b_prompt_insert = restart_edit;
if (restart_edit != NUL && mode_displayed) {
clear_cmdline = true; // unshow mode later
}
restart_edit = NUL;
// When leaving the window (or closing the window) was done from a