diff src/testdir/test_ins_complete.vim @ 17468:fa6c9047ec70 v8.1.1732

patch 8.1.1732: completion in cmdwin does not work for buffer-local commands commit https://github.com/vim/vim/commit/f03e328348f87e1fe8ce4aad2a6a4237b9f78ce3 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jul 22 21:55:18 2019 +0200 patch 8.1.1732: completion in cmdwin does not work for buffer-local commands Problem: Completion in cmdwin does not work for buffer-local commands. Solution: Use the right buffer. (closes https://github.com/vim/vim/issues/4711)
author Bram Moolenaar <Bram@vim.org>
date Mon, 22 Jul 2019 22:00:05 +0200
parents 749a7c03de8d
children 77c3f6428b6c
line wrap: on
line diff
--- a/src/testdir/test_ins_complete.vim
+++ b/src/testdir/test_ins_complete.vim
@@ -313,3 +313,21 @@ func Test_compl_feedkeys()
   bwipe!
   set completeopt&
 endfunc
+
+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 input = ''
+  call feedkeys("q:iGetInput T\<C-x>\<C-v>\<CR>", 'tx!')
+  call assert_equal('TestCommand', input)
+
+  let input = ''
+  call feedkeys("q::GetInput T\<Tab>\<CR>:q\<CR>", 'tx!')
+  call assert_equal('T', input)
+
+  delcom TestCommand
+  delcom GetInput
+  set wildmenu& wildchar&
+endfunc