mirror of
https://github.com/neovim/neovim.git
synced 2025-12-10 08:32:42 +00:00
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:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user