1
0
forked from aniani/vim

patch 8.2.4608: getcompletion() does not work when 'wildoptions' has "fuzzy"

Problem:    getcompletion() does not work properly when 'wildoptions
            contains "fuzzy".
Solution:   Do not use addstar(). (Yegappan Lakshmanan, closes #9992,
            closes #9986)
This commit is contained in:
Yegappan Lakshmanan
2022-03-22 16:06:31 +00:00
committed by Bram Moolenaar
parent 35dc17634d
commit e7dd0fa2c6
4 changed files with 28 additions and 1 deletions

View File

@@ -552,6 +552,22 @@ func Test_getcompletion()
call assert_fails('call getcompletion("abc", [])', 'E475:')
endfunc
" Test for getcompletion() with "fuzzy" in 'wildoptions'
func Test_getcompletion_wildoptions()
let save_wildoptions = &wildoptions
set wildoptions&
let l = getcompletion('space', 'option')
call assert_equal([], l)
let l = getcompletion('ier', 'command')
call assert_equal([], l)
set wildoptions=fuzzy
let l = getcompletion('space', 'option')
call assert_true(index(l, 'backspace') >= 0)
let l = getcompletion('ier', 'command')
call assert_true(index(l, 'compiler') >= 0)
let &wildoptions = save_wildoptions
endfunc
func Test_complete_autoload_error()
let save_rtp = &rtp
let lines =<< trim END