vim-patch:9.1.1505: not possible to return completion type for :ex command

Problem:  not possible to return command-line completion type for :ex
          command
Solution: make getcmdcompltype() accept an optional and return the
          command-line completion for that arg (Shougo Matsushita).

closes: vim/vim#17606

5d2354fc07

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
This commit is contained in:
zeertzjq
2025-07-06 08:29:46 +08:00
parent 8fe4e120a2
commit 6ebcb4a4d6
6 changed files with 67 additions and 32 deletions

View File

@ -4601,4 +4601,14 @@ func Test_range_complete()
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