Skip to content

Commit

Permalink
[utility] Simplify enabling 'diff' color conditions in wrapper function
Browse files Browse the repository at this point in the history
Nested `if` can be removed for simple cases like these.
Also, doc cleanup.
  • Loading branch information
indrajitr authored and belak committed Nov 13, 2017
1 parent 96bbb31 commit 2436806
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion modules/utility/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ Functions

### Developer

- `diff` highlights diff output (requires `colordiff` or `Git`).
- `diff` highlights diff output (requires `colordiff`).
- `make` highlights make output (requires `colormake`).
- `wdiff` highlights wdiff output (requires `wdiff `or `Git`).

Expand Down
7 changes: 2 additions & 5 deletions modules/utility/functions/diff
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@
#

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

0 comments on commit 2436806

Please sign in to comment.