utility module: fix/improve colordiff call in diff

The new call is compatible with colordiff v1.0.8 - v.1.0.15 (might be
compatible with even earlier versions, but not tested), while the
original one breaks down under v1.0.14 and v1.0.15. See
https://github.com/daveewart/colordiff/issues/22.
main
Zhiming Wang 10 years ago committed by Kaleb Elwert
parent 95d19b37c1
commit 464a8d20a1

@ -8,7 +8,7 @@
function diff { function diff {
if zstyle -t ':prezto:module:utility:diff' color; then if zstyle -t ':prezto:module:utility:diff' color; then
if (( $+commands[colordiff] )); then if (( $+commands[colordiff] )); then
command diff --unified "$@" | colordiff --difftype diffu command colordiff --unified "$@"
elif (( $+commands[git] )); then elif (( $+commands[git] )); then
git --no-pager diff --color=auto --no-ext-diff --no-index "$@" git --no-pager diff --color=auto --no-ext-diff --no-index "$@"
else else

Loading…
Cancel
Save