diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2017-03-14 00:44:03 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2017-04-28 19:19:51 +0200 |
commit | acfd2a2a29ae852ecc965ca888eb5049400bf39d (patch) | |
tree | 6c4dbe24eadf5dbd019e3483bb8057156a93112c /src/nvim/os/input.c | |
parent | 3ea10077534cb1dcb1597ffcf85e601fa0c0e27b (diff) | |
download | rneovim-acfd2a2a29ae852ecc965ca888eb5049400bf39d.tar.gz rneovim-acfd2a2a29ae852ecc965ca888eb5049400bf39d.tar.bz2 rneovim-acfd2a2a29ae852ecc965ca888eb5049400bf39d.zip |
input.c: Process only safe events before blocking.
Introduce multiqueue_process_priority() to process only events at or
above a certain priority.
Diffstat (limited to 'src/nvim/os/input.c')
-rw-r--r-- | src/nvim/os/input.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/nvim/os/input.c b/src/nvim/os/input.c index 26f2be6c02..de6d4a9010 100644 --- a/src/nvim/os/input.c +++ b/src/nvim/os/input.c @@ -341,12 +341,12 @@ static bool input_poll(int ms) prof_inchar_enter(); } - if ((ms == - 1 || ms > 0) - && !(events_enabled || input_ready() || input_eof) - ) { + if ((ms == - 1 || ms > 0) && !events_enabled && !input_eof) { + // We have discovered that the pending input will provoke a blocking wait. + // Process any events marked with priority `kEvPriorityAsync`: these events + // must be handled after flushing input. See channel.c:handle_request #6247 blocking = true; - multiqueue_process_debug(main_loop.events); - multiqueue_process_events(main_loop.events); + multiqueue_process_priority(main_loop.events, kEvPriorityAsync); } LOOP_PROCESS_EVENTS_UNTIL(&main_loop, NULL, ms, input_ready() || input_eof); blocking = false; |