0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 7.4.1578

Problem:    There is no way to invoke a function later or periodically.
Solution:   Add timer support.
This commit is contained in:
Bram Moolenaar
2016-03-15 23:10:59 +01:00
parent ab1fa3955f
commit 975b5271ee
14 changed files with 438 additions and 18 deletions

View File

@@ -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