diff --git a/autoload/fzf/vim.vim b/autoload/fzf/vim.vim index bab44c0..c38f882 100644 --- a/autoload/fzf/vim.vim +++ b/autoload/fzf/vim.vim @@ -52,7 +52,7 @@ endfunction function! s:wrap(name, opts, bang) " fzf#wrap does not append --expect if sink or sink* is found let opts = copy(a:opts) - if has_key(opts, 'sink*') + if get(opts, 'options', '') !~ '--expect' && has_key(opts, 'sink*') let Sink = remove(opts, 'sink*') let wrapped = fzf#wrap(a:name, opts, a:bang) let wrapped['sink*'] = Sink @@ -956,12 +956,14 @@ function! s:commits(buffer_local, args) endif let command = a:buffer_local ? 'BCommits' : 'Commits' - let options = s:wrap({ + let expect_keys = join(keys(get(g:, 'fzf_action', s:default_action)), ',') + let options = { \ 'source': source, \ 'sink*': s:function('s:commits_sink'), \ 'options': '--ansi --multi --no-sort --tiebreak=index --reverse '. - \ '--inline-info --prompt "'.command.'> " --bind=ctrl-s:toggle-sort' - \ }) + \ '--inline-info --prompt "'.command.'> " --bind=ctrl-s:toggle-sort '. + \ '--expect='.expect_keys + \ } if a:buffer_local let options.options .= ',ctrl-d --header ":: Press '.s:magenta('CTRL-S', 'Special').' to toggle sort, '.s:magenta('CTRL-D', 'Special').' to diff"'