aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/normal.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2021-09-17 21:17:51 +0800
committerGitHub <noreply@github.com>2021-09-17 06:17:51 -0700
commit5f144efefa66c9694123b679bab52992279a6015 (patch)
treebf6ee00beb9659467b8cb7ede25ce5644989446f /src/nvim/normal.c
parentc4b774470422a5c6849cbd89bc5464b790391ad8 (diff)
downloadrneovim-5f144efefa66c9694123b679bab52992279a6015.tar.gz
rneovim-5f144efefa66c9694123b679bab52992279a6015.tar.bz2
rneovim-5f144efefa66c9694123b679bab52992279a6015.zip
fix: prevent K_EVENT from stopping Select mode CTRL-O #15688
When using Goneovim, Select mode `CTRL-O` returns back to Select mode immediately (even with `--clean`). Neovim TUI (with some plugins) also randomly returns to Select mode even if no keys are pressed when using `CTRL-O` in Select mode.
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r--src/nvim/normal.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index 74aaed87c1..51e6827636 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -8404,13 +8404,13 @@ static void nv_event(cmdarg_T *cap)
// not safe to perform garbage collection because there could be unreferenced
// lists or dicts being used.
may_garbage_collect = false;
- bool may_restart = (restart_edit != 0);
+ bool may_restart = (restart_edit != 0 || restart_VIsual_select != 0);
state_handle_k_event();
finish_op = false;
if (may_restart) {
// Tricky: if restart_edit was set before the handler we are in ctrl-o mode,
// but if not, the event should be allowed to trigger :startinsert.
- cap->retval |= CA_COMMAND_BUSY; // don't call edit() now
+ cap->retval |= CA_COMMAND_BUSY; // don't call edit() or restart Select now
}
}