mirror of
https://github.com/junegunn/fzf.vim.git
synced 2025-12-07 21:24:40 +08:00
[[B]Commits] Enable diff only in BCommits / CTRL-S to toggle sort
This commit is contained in:
@@ -664,17 +664,18 @@ function! s:commits(buffer_local, args)
|
|||||||
let source .= ' --follow '.current
|
let source .= ' --follow '.current
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
let command = a:buffer_local ? 'BCommits' : 'Commits'
|
||||||
let options = {
|
let options = {
|
||||||
\ 'source': source,
|
\ 'source': source,
|
||||||
\ 'sink*': function('s:commits_sink'),
|
\ 'sink*': function('s:commits_sink'),
|
||||||
\ 'options': '--ansi --multi --no-sort --reverse --inline-info --prompt "Commits> "'.s:expect()
|
\ 'options': '--ansi --multi --no-sort --tiebreak=index --reverse '.
|
||||||
|
\ '--inline-info --prompt "'.command.'> " --bind=ctrl-s:toggle-sort'.s:expect()
|
||||||
\ }
|
\ }
|
||||||
|
|
||||||
if !empty(current)
|
if a:buffer_local
|
||||||
call system('git show '.current)
|
let options.options .= ',ctrl-d --header ":: Press '.s:magenta('CTRL-S').' to toggle sort, '.s:magenta('CTRL-D').' to diff"'
|
||||||
if !v:shell_error
|
else
|
||||||
let options.options .= ',ctrl-d --header ":: Press CTRL-D to diff"'
|
let options.options .= ' --header ":: '.s:magenta('CTRL-S').' to toggle sort"'
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call s:fzf(options, a:args)
|
call s:fzf(options, a:args)
|
||||||
|
|||||||
Reference in New Issue
Block a user