diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/eval/funcs.c | 3 | ||||
-rw-r--r-- | src/nvim/getchar.c | 2 | ||||
-rw-r--r-- | src/nvim/lua/executor.c | 2 | ||||
-rw-r--r-- | src/nvim/state.c | 2 |
4 files changed, 6 insertions, 3 deletions
diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c index 36d368a913..2d8ad458f1 100644 --- a/src/nvim/eval/funcs.c +++ b/src/nvim/eval/funcs.c @@ -2911,6 +2911,9 @@ static void f_wait(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) bool error = false; const int called_emsg_before = called_emsg; + // Flush screen updates before blocking. + ui_flush(); + LOOP_PROCESS_EVENTS_UNTIL(&main_loop, main_loop.events, timeout, eval_expr_typval(&expr, false, &argv, 0, &exprval) != OK || tv_get_number_chk(&exprval, &error) diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index 8b1e2f9105..2370df916c 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -1723,7 +1723,7 @@ static void getchar_common(typval_T *argvars, typval_T *rettv) // getchar(): blocking wait. // TODO(bfredl): deduplicate shared logic with state_enter ? if (!char_avail()) { - // flush output before waiting + // Flush screen updates before blocking. ui_flush(); (void)os_inchar(NULL, 0, -1, typebuf.tb_change_cnt, main_loop.events); if (!multiqueue_empty(main_loop.events)) { diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c index 3333c73bfd..876a5c34bd 100644 --- a/src/nvim/lua/executor.c +++ b/src/nvim/lua/executor.c @@ -463,7 +463,7 @@ static int nlua_wait(lua_State *lstate) int pcall_status = 0; bool callback_result = false; - // Flush UI before blocking + // Flush screen updates before blocking. ui_flush(); LOOP_PROCESS_EVENTS_UNTIL(&main_loop, diff --git a/src/nvim/state.c b/src/nvim/state.c index 61e8d8d2ff..d2466e4248 100644 --- a/src/nvim/state.c +++ b/src/nvim/state.c @@ -70,7 +70,7 @@ getkey: update_screen(); setcursor(); // put cursor back where it belongs } - // Flush screen updates before blocking + // Flush screen updates before blocking. ui_flush(); // Call `os_inchar` directly to block for events or user input without // consuming anything from `input_buffer`(os/input.c) or calling the |