mirror of
https://github.com/neovim/neovim
synced 2025-07-15 16:51:49 +00:00
vim-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: vim/vim#17606
closes: vim/vim#17662
96b3ef2389
Cherry-pick Test_multibyte_expression() from Vim, as it passes.
Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
This commit is contained in:
@ -737,6 +737,31 @@ func Test_getcompletion()
|
||||
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
|
||||
|
||||
" This was using uninitialized memory.
|
||||
let lines =<< trim END
|
||||
set verbose=6
|
||||
norm @=ٷ
|
||||
qall!
|
||||
END
|
||||
call writefile(lines, 'XmultiScript', 'D')
|
||||
call RunVim('', '', '-u NONE -n -e -s -S XmultiScript')
|
||||
endfunc
|
||||
|
||||
" Test for getcompletion() with "fuzzy" in 'wildoptions'
|
||||
func Test_getcompletion_wildoptions()
|
||||
let save_wildoptions = &wildoptions
|
||||
@ -4601,14 +4626,4 @@ 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
|
||||
|
Reference in New Issue
Block a user