diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-12-09 18:42:57 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-12-09 18:42:57 +0000 |
commit | 95b2dd0c008f0977ebb3cbe233a5064001a332e1 (patch) | |
tree | d797d7d90ff2277f2f1cca2910e1b3c7d8d4e364 /src/time.c | |
parent | e8a92b6166e32f8e583e01c9f541cf81cf76f8e6 (diff) | |
download | vim-git-95b2dd0c008f0977ebb3cbe233a5064001a332e1.tar.gz |
patch 8.2.3768: timer_info() has the wrong repeat value in a timer callbackv8.2.3768
Problem: timer_info() has the wrong repeat value in a timer callback.
Solution: Do not add one to the repeat value when in the callback.
(closes #9294)
Diffstat (limited to 'src/time.c')
-rw-r--r-- | src/time.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/time.c b/src/time.c index 362fd4645..bb4a20282 100644 --- a/src/time.c +++ b/src/time.c @@ -696,7 +696,8 @@ add_timer_info(typval_T *rettv, timer_T *timer) dict_add_number(dict, "remaining", (long)remaining); dict_add_number(dict, "repeat", - (long)(timer->tr_repeat < 0 ? -1 : timer->tr_repeat + 1)); + (long)(timer->tr_repeat < 0 ? -1 + : timer->tr_repeat + (timer->tr_firing ? 0 : 1))); dict_add_number(dict, "paused", (long)(timer->tr_paused)); di = dictitem_alloc((char_u *)"callback"); |