diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-06-24 16:03:06 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-06-24 16:03:06 +0200 |
commit | 1e8e14552e0cc8881411eb8fbe39a654dae42554 (patch) | |
tree | f28d457d94b1ac4db1fe700f23bb31d428e674d5 /src/testdir/test_timers.vim | |
parent | 24a9e348aa88a6c60ae0cdf5c4a777d8c03b08ca (diff) | |
download | vim-git-1e8e14552e0cc8881411eb8fbe39a654dae42554.tar.gz |
patch 8.0.0670: can't use input() in a timer callbackv8.0.0670
Problem: Can't use input() in a timer callback. (Cosmin Popescu)
Solution: Reset vgetc_busy and set timer_busy. (Ozaki Kiichi, closes #1790,
closes #1129)
Diffstat (limited to 'src/testdir/test_timers.vim')
-rw-r--r-- | src/testdir/test_timers.vim | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/testdir/test_timers.vim b/src/testdir/test_timers.vim index ebc666580..fdb74e795 100644 --- a/src/testdir/test_timers.vim +++ b/src/testdir/test_timers.vim @@ -172,5 +172,21 @@ func Test_stop_all_in_callback() call assert_equal(0, len(info)) endfunc +func FeedkeysCb(timer) + call feedkeys("hello\<CR>", 'nt') +endfunc + +func InputCb(timer) + call timer_start(10, 'FeedkeysCb') + let g:val = input('?') + call Resume() +endfunc + +func Test_input_in_timer() + let g:val = '' + call timer_start(10, 'InputCb') + call Standby(1000) + call assert_equal('hello', g:val) +endfunc " vim: shiftwidth=2 sts=2 expandtab |