Allow zero argument to fzf#complete
This commit is contained in:
parent
ca4163b57c
commit
c51e7f718c
1 changed files with 7 additions and 5 deletions
|
@ -437,15 +437,17 @@ function! s:complete_insert(lines)
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! fzf#complete(arg)
|
function! fzf#complete(...)
|
||||||
if type(a:arg) == type({})
|
if a:0 == 0
|
||||||
if has_key(a:arg, 'sink') || has_key(a:arg, 'sink*')
|
let s:opts = copy(get(g:, 'fzf_window', s:default_window))
|
||||||
|
elseif type(a:1) == type({})
|
||||||
|
if has_key(a:1, 'sink') || has_key(a:1, 'sink*')
|
||||||
echoerr 'sink not allowed'
|
echoerr 'sink not allowed'
|
||||||
return ''
|
return ''
|
||||||
endif
|
endif
|
||||||
let s:opts = a:arg
|
let s:opts = copy(a:1)
|
||||||
else
|
else
|
||||||
let s:opts = extend({'source': a:arg}, get(g:, 'fzf_window', s:default_window))
|
let s:opts = extend({'source': a:1}, get(g:, 'fzf_window', s:default_window))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let eol = col('$')
|
let eol = col('$')
|
||||||
|
|
Loading…
Add table
Reference in a new issue