patch 9.1.1157: command completion wrong for input()
Problem: command completion wrong for input()
(Cdrman Fu)
Solution: Set commandline completion context explicitly
(Jim Zhou)
fixes #16723
closes: #16733
Signed-off-by: Jim Zhou <csd_189@163.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim
index 6928cda..724fda0 100644
--- a/src/testdir/test_functions.vim
+++ b/src/testdir/test_functions.vim
@@ -2244,6 +2244,11 @@
call assert_fails("call input('F:', '', 'invalid')", 'E180:')
call assert_fails("call input('F:', '', [])", 'E730:')
+
+ " Test for using 'command' as the completion function
+ call feedkeys(":let c = input('Command? ', '', 'command')\<CR>"
+ \ .. "echo bufnam\<C-A>\<CR>", 'xt')
+ call assert_equal('echo bufname(', c)
endfunc
" Test for the inputdialog() function