diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-04-25 21:52:27 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2023-04-25 22:22:40 +0800 |
commit | cc6845db94ce1964c9fa15f451f33f7eb7bfb8df (patch) | |
tree | 4ee1118615d88e9d91836943f67f79e81763fd56 /test | |
parent | 255e547e18e127ab70ffa2e423f7753786cb424e (diff) | |
download | rneovim-cc6845db94ce1964c9fa15f451f33f7eb7bfb8df.tar.gz rneovim-cc6845db94ce1964c9fa15f451f33f7eb7bfb8df.tar.bz2 rneovim-cc6845db94ce1964c9fa15f451f33f7eb7bfb8df.zip |
vim-patch:8.2.3768: timer_info() has the wrong repeat value in a timer callback
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 vim/vim#9294)
https://github.com/vim/vim/commit/95b2dd0c008f0977ebb3cbe233a5064001a332e1
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'test')
-rw-r--r-- | test/old/testdir/test_timers.vim | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/old/testdir/test_timers.vim b/test/old/testdir/test_timers.vim index aa766fff40..ca9a312f95 100644 --- a/test/old/testdir/test_timers.vim +++ b/test/old/testdir/test_timers.vim @@ -94,6 +94,13 @@ func Test_timer_info() call assert_equal([], timer_info(id)) call assert_fails('call timer_info("abc")', 'E39:') + + " check repeat count inside the callback + let g:timer_repeat = [] + let tid = timer_start(10, {tid -> execute("call add(g:timer_repeat, timer_info(tid)[0].repeat)")}, #{repeat: 3}) + sleep 100m + call assert_equal([2, 1, 0], g:timer_repeat) + unlet g:timer_repeat endfunc func Test_timer_stopall() |