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

@@ -1024,7 +1024,7 @@ static int insert_handle_key(InsertState *s)
break;
case K_EVENT: // some event
multiqueue_process_events(main_loop.events);
state_handle_k_event();
goto check_pum;
case K_COMMAND: // some command