aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/state.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/state.c')
-rw-r--r--src/nvim/state.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/nvim/state.c b/src/nvim/state.c
index 1b08a08fba..908f724792 100644
--- a/src/nvim/state.c
+++ b/src/nvim/state.c
@@ -66,9 +66,11 @@ getkey:
// Event was made available after the last multiqueue_process_events call
key = K_EVENT;
} else {
- // Duplicate display updating logic in vgetorpeek()
- if (((State & MODE_INSERT) != 0 || p_lz) && (State & MODE_CMDLINE) == 0
- && must_redraw != 0 && !need_wait_return) {
+ // Ensure the screen is fully updated before blocking for input. Because of the duality of
+ // redraw_later, this can't be done in command-line or when waiting for "Press ENTER".
+ // In many of those cases the redraw is expected AFTER the key press, while normally it should
+ // update the screen immediately.
+ if (must_redraw != 0 && !need_wait_return && (State & MODE_CMDLINE) == 0) {
update_screen();
setcursor(); // put cursor back where it belongs
}