patch 9.1.1509: patch 9.1.1505 was not good
Problem: Patch 9.1.1505 was not good
Solution: Revert "patch 9.1.1505: not possible to return completion type
for :ex command" and instead add the getcompletiontype()
function (Hirohito Higashi).
related: #17606
closes: #17662
Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim
index 9ebeb0f..844f589 100644
--- a/src/testdir/test_cmdline.vim
+++ b/src/testdir/test_cmdline.vim
@@ -877,6 +877,17 @@
call assert_fails('call getcompletion("abc", [])', 'E1174:')
endfunc
+func Test_getcompletiontype()
+ call assert_fails('call getcompletiontype()', 'E119:')
+ call assert_fails('call getcompletiontype({})', 'E1174:')
+ call assert_equal(getcompletiontype(''), 'command')
+ call assert_equal(getcompletiontype('dummy '), '')
+ call assert_equal(getcompletiontype('cd '), 'dir_in_path')
+ call assert_equal(getcompletiontype('let v:n'), 'var')
+ call assert_equal(getcompletiontype('call tag'), 'function')
+ call assert_equal(getcompletiontype('help '), 'help')
+endfunc
+
func Test_multibyte_expression()
" Get a dialog in the GUI
CheckNotGui
@@ -4589,14 +4600,4 @@
set wildcharm=0
endfunc
-func Test_getcmdcompltype_with_pat()
- call assert_fails('call getcmdcompltype({})', 'E1174:')
- call assert_equal(getcmdcompltype(''), 'command')
- call assert_equal(getcmdcompltype('dummy '), '')
- call assert_equal(getcmdcompltype('cd '), 'dir_in_path')
- call assert_equal(getcmdcompltype('let v:n'), 'var')
- call assert_equal(getcmdcompltype('call tag'), 'function')
- call assert_equal(getcmdcompltype('help '), 'help')
-endfunc
-
" vim: shiftwidth=2 sts=2 expandtab