mirror of
https://github.com/junegunn/fzf.vim.git
synced 2025-12-06 20:54:28 +08:00
@@ -52,7 +52,7 @@ endfunction
|
|||||||
function! s:wrap(name, opts, bang)
|
function! s:wrap(name, opts, bang)
|
||||||
" fzf#wrap does not append --expect if sink or sink* is found
|
" fzf#wrap does not append --expect if sink or sink* is found
|
||||||
let opts = copy(a:opts)
|
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 Sink = remove(opts, 'sink*')
|
||||||
let wrapped = fzf#wrap(a:name, opts, a:bang)
|
let wrapped = fzf#wrap(a:name, opts, a:bang)
|
||||||
let wrapped['sink*'] = Sink
|
let wrapped['sink*'] = Sink
|
||||||
@@ -956,12 +956,14 @@ function! s:commits(buffer_local, args)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
let command = a:buffer_local ? 'BCommits' : 'Commits'
|
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,
|
\ 'source': source,
|
||||||
\ 'sink*': s:function('s:commits_sink'),
|
\ 'sink*': s:function('s:commits_sink'),
|
||||||
\ 'options': '--ansi --multi --no-sort --tiebreak=index --reverse '.
|
\ '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
|
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"'
|
let options.options .= ',ctrl-d --header ":: Press '.s:magenta('CTRL-S', 'Special').' to toggle sort, '.s:magenta('CTRL-D', 'Special').' to diff"'
|
||||||
|
|||||||
Reference in New Issue
Block a user