Mercurial > vim
diff src/testdir/test_channel.vim @ 20213:8d9229c4781a v8.2.0662
patch 8.2.0662: cannot use input() in a channel callback
Commit: https://github.com/vim/vim/commit/dfc33a665d3b12689aa971575b8e7de4e5202d83
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Apr 29 22:30:13 2020 +0200
patch 8.2.0662: cannot use input() in a channel callback
Problem: Cannot use input() in a channel callback.
Solution: Reset vgetc_busy. (closes https://github.com/vim/vim/issues/6010)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 29 Apr 2020 22:45:04 +0200 |
parents | 2fb397573541 |
children | a9516192b1db |
line wrap: on
line diff
--- 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