diff --git a/plugin/fzf.vim b/plugin/fzf.vim index 00f0e19..f08e017 100644 --- a/plugin/fzf.vim +++ b/plugin/fzf.vim @@ -26,7 +26,6 @@ let s:launcher = 'xterm -e bash -ic %s' let s:fzf_go = expand(':h:h').'/bin/fzf' let s:fzf_rb = expand(':h:h').'/fzf' let s:fzf_tmux = expand(':h:h').'/bin/fzf-tmux' -let s:legacy = 0 let s:cpo_save = &cpo set cpo&vim @@ -41,7 +40,6 @@ function! s:fzf_exec() let s:exec = path[0] elseif executable(s:fzf_rb) let s:exec = s:fzf_rb - let s:legacy = 1 else call system('type fzf') if v:shell_error @@ -326,10 +324,7 @@ function! s:cmd_callback(lines) abort endfunction function! s:cmd(bang, ...) abort - let args = copy(a:000) - if !s:legacy - let args = insert(args, '--expect=ctrl-t,ctrl-x,ctrl-v', 0) - endif + let args = extend(['--expect=ctrl-t,ctrl-x,ctrl-v'], a:000) let opts = {} if len(args) > 0 && isdirectory(expand(args[-1])) let opts.dir = remove(args, -1) @@ -337,15 +332,10 @@ function! s:cmd(bang, ...) abort if !a:bang let opts.down = get(g:, 'fzf_tmux_height', s:default_tmux_height) endif - - if s:legacy - call fzf#run(extend({ 'options': join(args), 'sink': 'e' }, opts)) - else - call fzf#run(extend({ 'options': join(args), 'sink*': function('cmd_callback') }, opts)) - endif + call fzf#run(extend({'options': join(args), 'sink*': function('cmd_callback')}, opts)) endfunction -command! -nargs=* -complete=dir -bang FZF call s:cmd('' == '!', ) +command! -nargs=* -complete=dir -bang FZF call s:cmd(0, ) let &cpo = s:cpo_save unlet s:cpo_save