zsh:glog: Pipe preview through diff-so-fancy

This commit is contained in:
2020-09-24 03:30:53 +02:00
parent 7e0e0f5baf
commit f69efff5c0

View File

@@ -27,8 +27,6 @@ local format=(
' %s%Creset' # bold white subject
' ' # space is here so that the empty line is not eaten when empty body
'%-b' # body
'--------------------------------------------------'
''
)
# Before being able to operate on the string itself we need to remove all ansi
@@ -55,7 +53,8 @@ local -a fzf_args=(
"--preview" "
out=\"\$(echo {} | sed -Ee \"$del_ansi\" -e \"$commit_hash\")\"
if [ \"\$out\" ]; then
git show \"${(j:%n:)format}\" \"$date\" $colors \"\$out\"
git show \"${(j:%n:)format}\" \"$date\" $colors \"\$out\" \
| diff-so-fancy
fi
"
# Reverse the layout so that the newest commit is at the top.