From 1f7bfa4007043c30027b2cd79625e8aac5cff1f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Janou=C5=A1ek?= Date: Tue, 1 Feb 2022 06:34:48 +0000 Subject: [PATCH] [[B]Commits] Use --color=always with delta as well (#1362) With some delta configurations (e.g. color-only = true, diff-highlight = true), delta doesn't add its own coloring and keeps that from git diff, and thus we need to turn that on. Additionally, delta doesn't do its own detection of moved lines and relies on git diff's colorMoved, which also needs enabling of colors. --- autoload/fzf/vim.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/fzf/vim.vim b/autoload/fzf/vim.vim index 90ded42..b25a962 100644 --- a/autoload/fzf/vim.vim +++ b/autoload/fzf/vim.vim @@ -1229,9 +1229,9 @@ function! s:commits(range, buffer_local, args) endif if !s:is_win && &columns > s:wide - let suffix = executable('delta') ? '| delta --width $FZF_PREVIEW_COLUMNS' : '--color=always' + let suffix = executable('delta') ? '| delta --width $FZF_PREVIEW_COLUMNS' : '' call extend(options.options, - \ ['--preview', 'echo {} | grep -o "[a-f0-9]\{7,\}" | head -1 | xargs git show --format=format: ' . suffix]) + \ ['--preview', 'echo {} | grep -o "[a-f0-9]\{7,\}" | head -1 | xargs git show --format=format: --color=always ' . suffix]) endif return s:fzf(a:buffer_local ? 'bcommits' : 'commits', options, a:args)