mirror of
https://github.com/dcarrillo/prezto.git
synced 2024-12-22 18:38:00 +00:00
[utility] Simplify enabling 'diff' color conditions in wrapper function
Nested `if` can be removed for simple cases like these. Also, doc cleanup.
This commit is contained in:
parent
96bbb31cc8
commit
2436806fce
@ -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`).
|
||||||
|
|
||||||
|
@ -6,15 +6,12 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
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
|
else
|
||||||
command diff "$@"
|
command diff "$@"
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
command diff "$@"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
diff "$@"
|
diff "$@"
|
||||||
|
Loading…
Reference in New Issue
Block a user