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 #4711)
diff --git a/src/testdir/test_ins_complete.vim b/src/testdir/test_ins_complete.vim
index d88b003..c028df3 100644
--- a/src/testdir/test_ins_complete.vim
+++ b/src/testdir/test_ins_complete.vim
@@ -313,3 +313,21 @@
   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