state: throttle batched event processing when input is available

before, calling vim.schedule() from inside an event would execute
the scheduled callback immediately after this event without
checking for user input in between. Break event processing
whenever user input or an interrupt is available.
This commit is contained in:
Björn Linse
2021-01-04 19:04:21 +01:00
parent c12ea02e0b
commit f901149de4
9 changed files with 81 additions and 17 deletions

View File

@@ -8103,7 +8103,7 @@ static void nv_event(cmdarg_T *cap)
// lists or dicts being used.
may_garbage_collect = false;
bool may_restart = (restart_edit != 0);
multiqueue_process_events(main_loop.events);
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,