From e50aa2a6c65453067ae3554157fdd31ac8af6168 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Tue, 4 Jun 2019 13:12:57 +0200 Subject: normal: Don't exit CTRL-O mode after processing K_EVENT --- src/nvim/normal.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/nvim') diff --git a/src/nvim/normal.c b/src/nvim/normal.c index db2da6a807..7e295d9ca3 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -7983,8 +7983,14 @@ 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); multiqueue_process_events(main_loop.events); 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 allow to trigger :startinsert + cap->retval |= CA_COMMAND_BUSY; // don't call edit() now + } } /* -- cgit