Allow fzf#complete to take hash argument with sink

This allows us to use the return value of fzf#wrap function with
fzf#complete.

This commit also removes obsolete g:fzf#vim#default_layout and
fzf#vim#layout.
This commit is contained in:
Junegunn Choi
2017-06-28 21:19:11 +09:00
parent ccc32c3164
commit 348a57a4a4
5 changed files with 20 additions and 19 deletions

View File

@@ -48,7 +48,7 @@ endif
function! fzf#vim#complete#word(...)
return fzf#vim#complete(s:extend({
\ 'source': 'cat /usr/share/dict/words'},
\ get(a:000, 0, g:fzf#vim#default_layout)))
\ get(a:000, 0, fzf#wrap())))
endfunction
" ----------------------------------------------------------------------------
@@ -128,7 +128,7 @@ function! fzf#vim#complete#path(command, ...)
return fzf#vim#complete(s:extend({
\ 'prefix': s:function('s:fname_prefix'),
\ 'source': s:function('s:file_source'),
\ 'options': s:function('s:file_options')}, get(a:000, 0, g:fzf#vim#default_layout)))
\ 'options': s:function('s:file_options')}, get(a:000, 0, fzf#wrap())))
endfunction
" ----------------------------------------------------------------------------
@@ -147,13 +147,13 @@ function! fzf#vim#complete#line(...)
\ 'prefix': '^.*$',
\ 'source': lines,
\ 'options': '--tiebreak=index --ansi --nth '.nth.'.. --tabstop=1',
\ 'reducer': s:function('s:reduce_line')}, get(a:000, 0, g:fzf#vim#default_layout)))
\ 'reducer': s:function('s:reduce_line')}, get(a:000, 0, fzf#wrap())))
endfunction
function! fzf#vim#complete#buffer_line(...)
return fzf#vim#complete(s:extend({
\ 'prefix': '^.*$',
\ 'source': fzf#vim#_uniq(getline(1, '$'))}, get(a:000, 0, g:fzf#vim#default_layout)))
\ 'source': fzf#vim#_uniq(getline(1, '$'))}, get(a:000, 0, fzf#wrap())))
endfunction
let &cpo = s:cpo_save