aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2017-04-06 08:55:51 -0400
committerJames McCoy <jamessan@jamessan.com>2017-04-06 08:56:35 -0400
commit0f99645b8faf3e5970e46c185c0cbbd7a9cfe318 (patch)
tree159b5f504a8da812dc0bffd9fc4ccd1b2fc41216
parent6a6bbbc6d8fa79a0c14fb913baa3ba2d7046419c (diff)
downloadrneovim-0f99645b8faf3e5970e46c185c0cbbd7a9cfe318.tar.gz
rneovim-0f99645b8faf3e5970e46c185c0cbbd7a9cfe318.tar.bz2
rneovim-0f99645b8faf3e5970e46c185c0cbbd7a9cfe318.zip
vim-patch:7.4.2304
Problem: In a timer callback the timer itself can't be found or stopped. (Thinca) Solution: Do not remove the timer from the list, remember whether it was freed. https://github.com/vim/vim/commit/417ccd7138d4d230d328de8b0d3892dd82ff1bee
-rw-r--r--src/nvim/testdir/test_timers.vim15
-rw-r--r--src/nvim/version.c2
2 files changed, 16 insertions, 1 deletions
diff --git a/src/nvim/testdir/test_timers.vim b/src/nvim/testdir/test_timers.vim
index 16c70b166b..6a8b09c898 100644
--- a/src/nvim/testdir/test_timers.vim
+++ b/src/nvim/testdir/test_timers.vim
@@ -125,4 +125,19 @@ func Test_paused()
endif
endfunc
+func StopMyself(timer)
+ let g:called += 1
+ if g:called == 2
+ call timer_stop(a:timer)
+ endif
+endfunc
+
+func Test_delete_myself()
+ let g:called = 0
+ let t = timer_start(10, 'StopMyself', {'repeat': -1})
+ call WaitFor('g:called == 2')
+ call assert_equal(2, g:called)
+ call assert_equal([], timer_info(t))
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/nvim/version.c b/src/nvim/version.c
index 3944551cb4..beb23090ec 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -137,7 +137,7 @@ static const int included_patches[] = {
2307,
2306,
2305,
- // 2304 NA
+ 2304,
2303,
// 2302 NA
// 2301 NA