Browse Source

[utility] Simplify enabling 'diff' color conditions in wrapper function

Nested `if` can be removed for simple cases like these.
Also, doc cleanup.
master
Indrajit Raychaudhuri 7 years ago committed by Kaleb Elwert
parent
commit
b018e22751
  1. 2
      modules/utility/README.md
  2. 7
      modules/utility/functions/diff

2
modules/utility/README.md

@ -153,7 +153,7 @@ Functions
### Developer ### Developer
- `diff` highlights diff output (requires `colordiff` or `Git`). - `diff` highlights diff output (requires `colordiff`).
- `make` highlights make output (requires `colormake`). - `make` highlights make output (requires `colormake`).
- `wdiff` highlights wdiff output (requires `wdiff `or `Git`). - `wdiff` highlights wdiff output (requires `wdiff `or `Git`).

7
modules/utility/functions/diff

@ -6,12 +6,9 @@
# #
function diff { function diff {
if zstyle -t ':prezto:module:utility:diff' color; then if zstyle -t ':prezto:module:utility:diff' color \
if (( $+commands[colordiff] )); then && (( $+commands[colordiff] )); then
command colordiff "$@" command colordiff "$@"
else
command diff "$@"
fi
else else
command diff "$@" command diff "$@"
fi fi

Loading…
Cancel
Save