diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-10-20 23:02:56 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-20 23:02:56 +0800 |
commit | ad2fad9a3b07d84e24c189b6a5773e979e8c0afd (patch) | |
tree | 97151f1fabf084f7a0bc6b7fc31436222ec0fff5 | |
parent | 6c87d3e0fbf88ae693be11a3ede3a1ec6ec0e30e (diff) | |
download | rneovim-ad2fad9a3b07d84e24c189b6a5773e979e8c0afd.tar.gz rneovim-ad2fad9a3b07d84e24c189b6a5773e979e8c0afd.tar.bz2 rneovim-ad2fad9a3b07d84e24c189b6a5773e979e8c0afd.zip |
fix(event-loop): flush UI when no input is available (#25728)
Problem: With lots of events, UI flush may be delayed for too long.
Solution: Flush UI when no input is available. This still flushes less
frequently than before #25629, when a flush also happens when
typeahead buffer is empty but input is available.
-rw-r--r-- | src/nvim/state.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/nvim/state.c b/src/nvim/state.c index 424fda2ede..61e8d8d2ff 100644 --- a/src/nvim/state.c +++ b/src/nvim/state.c @@ -59,6 +59,8 @@ getkey: if (vpeekc() != NUL || typebuf.tb_len > 0) { key = safe_vgetc(); } else if (!multiqueue_empty(main_loop.events)) { + // No input available and processing events may take time, flush now. + ui_flush(); // Event was made available after the last multiqueue_process_events call key = K_EVENT; } else { |