commit ad2fad9a3b07d84e24c189b6a5773e979e8c0afd
parent 6c87d3e0fbf88ae693be11a3ede3a1ec6ec0e30e
Author: zeertzjq <zeertzjq@outlook.com>
Date: Fri, 20 Oct 2023 23:02:56 +0800
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.
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git 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 {