diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-04-29 22:30:13 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-04-29 22:30:13 +0200 |
commit | dfc33a665d3b12689aa971575b8e7de4e5202d83 (patch) | |
tree | 8c046a483c6b78d558f9ad178ed7e9369c4efe5c /src/testdir | |
parent | 339d60c89bef0315343a6128a1b4826510b0efe4 (diff) | |
download | vim-git-dfc33a665d3b12689aa971575b8e7de4e5202d83.tar.gz |
patch 8.2.0662: cannot use input() in a channel callbackv8.2.0662
Problem: Cannot use input() in a channel callback.
Solution: Reset vgetc_busy. (closes #6010)
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_channel.vim | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim index 4a438ea72..019b95925 100644 --- a/src/testdir/test_channel.vim +++ b/src/testdir/test_channel.vim @@ -6,6 +6,7 @@ CheckFeature channel source shared.vim source screendump.vim +source view_util.vim let s:python = PythonProg() if s:python == '' @@ -2297,4 +2298,20 @@ func Test_job_with_list_args() %bw! endfunc +func ExitCb_cb_with_input(job, status) + call feedkeys(":\<C-u>echo input('', 'default')\<CR>\<CR>", 'nx') + call assert_equal('default', Screenline(&lines)) + let g:wait_exit_cb = 0 +endfunc + +func Test_cb_with_input() + let g:wait_exit_cb = 1 + + call job_start('echo "Vim''s test"', + \ {'out_cb': 'ExitCb_cb_with_input'}) + call WaitForAssert({-> assert_equal(0, g:wait_exit_cb)}) + + unlet g:wait_exit_cb +endfunc + " vim: shiftwidth=2 sts=2 expandtab |