From b018e227516612dd7f9597738872442aceded356 Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Thu, 20 Jul 2017 22:58:29 -0500 Subject: [PATCH] [utility] Simplify enabling 'diff' color conditions in wrapper function Nested `if` can be removed for simple cases like these. Also, doc cleanup. --- modules/utility/README.md | 2 +- modules/utility/functions/diff | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/modules/utility/README.md b/modules/utility/README.md index a2b93be..84e81f5 100644 --- a/modules/utility/README.md +++ b/modules/utility/README.md @@ -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`). diff --git a/modules/utility/functions/diff b/modules/utility/functions/diff index 51806e8..d614b28 100644 --- a/modules/utility/functions/diff +++ b/modules/utility/functions/diff @@ -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