diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-08-27 21:30:03 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-08-27 21:30:03 +0100 |
commit | 9198de3ae2bd20ac51d580c44f2b43c282c1e773 (patch) | |
tree | 5a101dfee6a8a29a9000443cdf61a2e822a9f2c5 /src/time.c | |
parent | aebc6ef7cdc5d4d0627a711ff66e6fe8d67f9d87 (diff) |
patch 9.0.0288: when 'cmdheight' is zero some messages are not displayedv9.0.0288
Problem: When 'cmdheight' is zero some messages are not displayed.
Solution: Use a popup notification window.
Diffstat (limited to 'src/time.c')
-rw-r--r-- | src/time.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/time.c b/src/time.c index dc8594a2cd..c28e7a97b7 100644 --- a/src/time.c +++ b/src/time.c @@ -464,11 +464,21 @@ create_timer(long msec, int repeat) timer->tr_repeat = repeat - 1; timer->tr_interval = msec; - profile_setlimit(msec, &timer->tr_due); + timer_start(timer); return timer; } /* + * (Re)start a timer. + */ + void +timer_start(timer_T *timer) +{ + profile_setlimit(timer->tr_interval, &timer->tr_due); + timer->tr_paused = FALSE; +} + +/* * Invoke the callback of "timer". */ static void @@ -603,8 +613,13 @@ check_due_timer(void) else { this_due = -1; - remove_timer(timer); - free_timer(timer); + if (timer->tr_keep) + timer->tr_paused = TRUE; + else + { + remove_timer(timer); + free_timer(timer); + } } } if (this_due > 0 && (next_due == -1 || next_due > this_due)) @@ -826,6 +841,7 @@ f_timer_pause(typval_T *argvars, typval_T *rettv UNUSED) else { int paused = (int)tv_get_bool(&argvars[1]); + timer = find_timer((int)tv_get_number(&argvars[0])); if (timer != NULL) timer->tr_paused = paused; |