mirror of
https://github.com/junegunn/fzf.vim.git
synced 2026-08-12 19:06:54 +08:00
Allow zero argument to fzf#complete
This commit is contained in:
+7
-5
@@ -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('$')
|
||||||
|
|||||||
Reference in New Issue
Block a user