diff options
| author | Sean Dewar <seandewar@users.noreply.github.com> | 2022-01-31 01:04:10 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-31 01:04:10 +0000 |
| commit | 2870311a37314135b73e0ee54b41da86c9540a39 (patch) | |
| tree | 8e1a1f1475b322c613a4886e37600b57824ef746 /src/nvim/testdir/test_ins_complete.vim | |
| parent | d38f81849bac5cf8fb95643f4f01a45c68d5370c (diff) | |
| parent | c91fbc1b9e8b56e260555b14cd3bc4b9b4874037 (diff) | |
| download | rneovim-2870311a37314135b73e0ee54b41da86c9540a39.tar.gz rneovim-2870311a37314135b73e0ee54b41da86c9540a39.tar.bz2 rneovim-2870311a37314135b73e0ee54b41da86c9540a39.zip | |
Merge pull request #17239 from seandewar/vim-8.2.3629
vim-patch:8.2.{3433,3629}
Diffstat (limited to 'src/nvim/testdir/test_ins_complete.vim')
| -rw-r--r-- | src/nvim/testdir/test_ins_complete.vim | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_ins_complete.vim b/src/nvim/testdir/test_ins_complete.vim index 6803271c03..f066d842b4 100644 --- a/src/nvim/testdir/test_ins_complete.vim +++ b/src/nvim/testdir/test_ins_complete.vim @@ -341,6 +341,14 @@ func Test_compl_feedkeys() set completeopt& endfunc +func s:ComplInCmdwin_GlobalCompletion(a, l, p) + return 'global' +endfunc + +func s:ComplInCmdwin_LocalCompletion(a, l, p) + return 'local' +endfunc + func Test_compl_in_cmdwin() set wildmenu wildchar=<Tab> com! -nargs=1 -complete=command GetInput let input = <q-args> @@ -376,6 +384,47 @@ func Test_compl_in_cmdwin() call feedkeys("q::GetInput b:test_\<Tab>\<CR>:q\<CR>", 'tx!') call assert_equal('b:test_', input) + + " Argument completion of buffer-local command + func s:ComplInCmdwin_GlobalCompletionList(a, l, p) + return ['global'] + endfunc + + func s:ComplInCmdwin_LocalCompletionList(a, l, p) + return ['local'] + endfunc + + func s:ComplInCmdwin_CheckCompletion(arg) + call assert_equal('local', a:arg) + endfunc + + com! -nargs=1 -complete=custom,<SID>ComplInCmdwin_GlobalCompletion + \ TestCommand call s:ComplInCmdwin_CheckCompletion(<q-args>) + com! -buffer -nargs=1 -complete=custom,<SID>ComplInCmdwin_LocalCompletion + \ TestCommand call s:ComplInCmdwin_CheckCompletion(<q-args>) + call feedkeys("q:iTestCommand \<Tab>\<CR>", 'tx!') + + com! -nargs=1 -complete=customlist,<SID>ComplInCmdwin_GlobalCompletionList + \ TestCommand call s:ComplInCmdwin_CheckCompletion(<q-args>) + com! -buffer -nargs=1 -complete=customlist,<SID>ComplInCmdwin_LocalCompletionList + \ TestCommand call s:ComplInCmdwin_CheckCompletion(<q-args>) + + call feedkeys("q:iTestCommand \<Tab>\<CR>", 'tx!') + + func! s:ComplInCmdwin_CheckCompletion(arg) + call assert_equal('global', a:arg) + endfunc + new + call feedkeys("q:iTestCommand \<Tab>\<CR>", 'tx!') + quit + + delfunc s:ComplInCmdwin_GlobalCompletion + delfunc s:ComplInCmdwin_LocalCompletion + delfunc s:ComplInCmdwin_GlobalCompletionList + delfunc s:ComplInCmdwin_LocalCompletionList + delfunc s:ComplInCmdwin_CheckCompletion + + delcom -buffer TestCommand delcom TestCommand delcom GetInput unlet w:test_winvar |