diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-04-25 22:21:19 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2023-04-25 22:22:40 +0800 |
commit | 255e547e18e127ab70ffa2e423f7753786cb424e (patch) | |
tree | 1df89958514bdc37d013ad478d6e22177b000a54 | |
parent | bfa92d3861e425b59f9b1793c08247965a8e53f5 (diff) | |
download | rneovim-255e547e18e127ab70ffa2e423f7753786cb424e.tar.gz rneovim-255e547e18e127ab70ffa2e423f7753786cb424e.tar.bz2 rneovim-255e547e18e127ab70ffa2e423f7753786cb424e.zip |
fix(timer): allow timer_info() to get info about current timer
-rw-r--r-- | src/nvim/eval.c | 2 | ||||
-rw-r--r-- | src/nvim/eval/funcs.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index bc33697c62..b3618c1811 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -6002,7 +6002,7 @@ void add_timer_info_all(typval_T *rettv) tv_list_alloc_ret(rettv, map_size(&timers)); timer_T *timer; map_foreach_value(&timers, timer, { - if (!timer->stopped) { + if (!timer->stopped || timer->refcount > 1) { add_timer_info(rettv, timer); } }) diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c index 72e25411ff..3cf18e1c68 100644 --- a/src/nvim/eval/funcs.c +++ b/src/nvim/eval/funcs.c @@ -8944,7 +8944,7 @@ static void f_timer_info(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) } tv_list_alloc_ret(rettv, 1); timer_T *timer = find_timer_by_nr(tv_get_number(&argvars[0])); - if (timer != NULL && !timer->stopped) { + if (timer != NULL && (!timer->stopped || timer->refcount > 1)) { add_timer_info(rettv, timer); } } else { |