eval: implement timers. vim-patch: 7.4.1578, 7.4.1831

For the moment, timers are triggered during sleep,
but not in wait-for-input modes, like press-RETURN or f_getchar()
This commit is contained in:
Björn Linse
2016-04-21 17:06:03 +02:00
parent 176f223ea3
commit 61e8adb25e
10 changed files with 318 additions and 13 deletions

View File

@@ -6989,10 +6989,10 @@ static void ex_sleep(exarg_T *eap)
*/
void do_sleep(long msec)
{
long done;
ui_flush(); // flush before waiting
for (done = 0; !got_int && done < msec; done += 1000L) {
os_delay(msec - done > 1000L ? 1000L : msec - done, true);
for (long left = msec; !got_int && left > 0; left -= 1000L) {
int next = left > 1000l ? 1000 : (int)left;
LOOP_PROCESS_EVENTS_UNTIL(&loop, loop.events, (int)next, got_int);
os_breakcheck();
}
}