diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-10-25 13:22:42 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-10-25 13:22:42 +0100 |
commit | 4ff2f2fb6bef01a06bd726bae8dfa8dd6355d594 (patch) | |
tree | 7d98d6873b30cc0b37cd676da22a4ba660fc6403 /src/testdir/test_ins_complete.vim | |
parent | 02194d2bd54eacd0b7b9a017a3fe1702ecb80971 (diff) |
patch 8.2.1901: variable completion does not work in command line windowv8.2.1901
Problem: Variable completion does not work in command line window.
Solution: Use the "prevwin". (closes #7198)
Diffstat (limited to 'src/testdir/test_ins_complete.vim')
-rw-r--r-- | src/testdir/test_ins_complete.vim | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/testdir/test_ins_complete.vim b/src/testdir/test_ins_complete.vim index 005e14caf0..8c676e22a9 100644 --- a/src/testdir/test_ins_complete.vim +++ b/src/testdir/test_ins_complete.vim @@ -346,7 +346,10 @@ func Test_compl_in_cmdwin() set wildmenu wildchar=<Tab> com! -nargs=1 -complete=command GetInput let input = <q-args> com! -buffer TestCommand echo 'TestCommand' + let w:test_winvar = 'winvar' + let b:test_bufvar = 'bufvar' + " User-defined commands let input = '' call feedkeys("q:iGetInput T\<C-x>\<C-v>\<CR>", 'tx!') call assert_equal('TestCommand', input) @@ -355,8 +358,30 @@ func Test_compl_in_cmdwin() call feedkeys("q::GetInput T\<Tab>\<CR>:q\<CR>", 'tx!') call assert_equal('T', input) + + com! -nargs=1 -complete=var GetInput let input = <q-args> + " Window-local variables + let input = '' + call feedkeys("q:iGetInput w:test_\<C-x>\<C-v>\<CR>", 'tx!') + call assert_equal('w:test_winvar', input) + + let input = '' + call feedkeys("q::GetInput w:test_\<Tab>\<CR>:q\<CR>", 'tx!') + call assert_equal('w:test_', input) + + " Buffer-local variables + let input = '' + call feedkeys("q:iGetInput b:test_\<C-x>\<C-v>\<CR>", 'tx!') + call assert_equal('b:test_bufvar', input) + + let input = '' + call feedkeys("q::GetInput b:test_\<Tab>\<CR>:q\<CR>", 'tx!') + call assert_equal('b:test_', input) + delcom TestCommand delcom GetInput + unlet w:test_winvar + unlet b:test_bufvar set wildmenu& wildchar& endfunc |