Mercurial > vim
comparison src/testdir/test_timers.vim @ 11575:0ec755ff1fe2 v8.0.0670
patch 8.0.0670: can't use input() in a timer callback
commit https://github.com/vim/vim/commit/1e8e14552e0cc8881411eb8fbe39a654dae42554
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jun 24 16:03:06 2017 +0200
patch 8.0.0670: can't use input() in a timer callback
Problem: Can't use input() in a timer callback. (Cosmin Popescu)
Solution: Reset vgetc_busy and set timer_busy. (Ozaki Kiichi, closes https://github.com/vim/vim/issues/1790,
closes #1129)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 24 Jun 2017 16:15:03 +0200 |
parents | 776d0aef1d80 |
children | 71d7b5ed08a0 |
comparison
equal
deleted
inserted
replaced
11574:9a74b20327e4 | 11575:0ec755ff1fe2 |
---|---|
170 sleep 40m | 170 sleep 40m |
171 let info = timer_info() | 171 let info = timer_info() |
172 call assert_equal(0, len(info)) | 172 call assert_equal(0, len(info)) |
173 endfunc | 173 endfunc |
174 | 174 |
175 func FeedkeysCb(timer) | |
176 call feedkeys("hello\<CR>", 'nt') | |
177 endfunc | |
178 | |
179 func InputCb(timer) | |
180 call timer_start(10, 'FeedkeysCb') | |
181 let g:val = input('?') | |
182 call Resume() | |
183 endfunc | |
184 | |
185 func Test_input_in_timer() | |
186 let g:val = '' | |
187 call timer_start(10, 'InputCb') | |
188 call Standby(1000) | |
189 call assert_equal('hello', g:val) | |
190 endfunc | |
175 | 191 |
176 " vim: shiftwidth=2 sts=2 expandtab | 192 " vim: shiftwidth=2 sts=2 expandtab |