aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSean Dewar <seandewar@users.noreply.github.com>2021-10-03 14:00:24 +0100
committerSean Dewar <seandewar@users.noreply.github.com>2021-12-07 11:34:26 +0000
commitd6ea0741c92e39e4f6c3ec639117d9f39ec08094 (patch)
tree9fc5d55996cb79ce17bea7baef462da66138e8ee /src
parent28134f4e78819c2bbf0344326b9d44f21eb0d736 (diff)
downloadrneovim-d6ea0741c92e39e4f6c3ec639117d9f39ec08094.tar.gz
rneovim-d6ea0741c92e39e4f6c3ec639117d9f39ec08094.tar.bz2
rneovim-d6ea0741c92e39e4f6c3ec639117d9f39ec08094.zip
fix(prompt): add missing changes from v8.1.0036
v8.1.0036 is already marked as ported, but missed out changes that depended on v8.1.0035.
Diffstat (limited to 'src')
-rw-r--r--src/nvim/window.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c
index 1da6c3704f..9f4c5c68f6 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -2241,12 +2241,21 @@ static void leaving_window(win_T *const win)
// callback we need to break out of the Insert mode loop.
if (State & INSERT) {
stop_insert_mode = true;
+ if (bt_prompt(win->w_buffer) && win->w_buffer->b_prompt_insert == NUL) {
+ win->w_buffer->b_prompt_insert = 'A';
+ }
}
}
static void entering_window(win_T *const win)
FUNC_ATTR_NONNULL_ALL
{
+ // When switching to a prompt buffer that was in Insert mode, don't stop
+ // Insert mode, it may have been set in leaving_window().
+ if (bt_prompt(win->w_buffer) && win->w_buffer->b_prompt_insert != NUL) {
+ stop_insert_mode = false;
+ }
+
// When entering the prompt window may restart Insert mode.
restart_edit = win->w_buffer->b_prompt_insert;
}