[[B]Commits] Use delta if available

This commit is contained in:
Junegunn Choi
2020-12-14 00:12:22 +09:00
parent 65b6cdb0f2
commit 54b3817db2
3 changed files with 7 additions and 4 deletions

View File

@@ -1221,8 +1221,9 @@ function! s:commits(buffer_local, args)
endif
if !s:is_win && &columns > s:wide
let suffix = executable('delta') ? '| delta' : '--color=always'
call extend(options.options,
\ ['--preview', 'echo {} | grep -o "[a-f0-9]\{7,\}" | head -1 | xargs git show --format=format: --color=always | head -1000'])
\ ['--preview', 'echo {} | grep -o "[a-f0-9]\{7,\}" | head -1 | xargs git show --format=format: ' . suffix])
endif
return s:fzf(a:buffer_local ? 'bcommits' : 'commits', options, a:args)