mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
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.
417ccd7138
This commit is contained in:
parent
6a6bbbc6d8
commit
0f99645b8f
@ -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
|
||||
|
@ -137,7 +137,7 @@ static const int included_patches[] = {
|
||||
2307,
|
||||
2306,
|
||||
2305,
|
||||
// 2304 NA
|
||||
2304,
|
||||
2303,
|
||||
// 2302 NA
|
||||
// 2301 NA
|
||||
|
Loading…
Reference in New Issue
Block a user