diff options
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r-- | src/ex_docmd.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 9b116e2bd..12730a93d 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -8894,12 +8894,22 @@ ex_sleep(exarg_T *eap) do_sleep(long msec) { long done; + long wait_now; cursor_on(); out_flush(); - for (done = 0; !got_int && done < msec; done += 1000L) + for (done = 0; !got_int && done < msec; done += wait_now) { - ui_delay(msec - done > 1000L ? 1000L : msec - done, TRUE); + wait_now = msec - done > 1000L ? 1000L : msec - done; +#ifdef FEAT_TIMERS + { + long due_time = check_due_timer(); + + if (due_time > 0 && due_time < wait_now) + wait_now = due_time; + } +#endif + ui_delay(wait_now, TRUE); ui_breakcheck(); #ifdef MESSAGE_QUEUE /* Process the netbeans and clientserver messages that may have been |