Pretzo's modules/utility/functions/diff registers an autoload stub that emits '(eval):1: diff: function definition file not found' in non- interactive eval contexts where $fpath doesn't include the utility module's functions directory. Define diff as a real function up front so the stub never has to look itself up.
14 lines
522 B
Bash
14 lines
522 B
Bash
# Eagerly define `diff` as a real function instead of relying on prezto's
|
|
# autoload stub. The autoload stub emits
|
|
# "(eval):1: diff: function definition file not found"
|
|
# in non-interactive eval contexts where $fpath doesn't yet include the
|
|
# prezto utility module's functions directory. Defining a real function
|
|
# here bypasses the autoload path entirely.
|
|
function diff {
|
|
if (( $+commands[colordiff] )); then
|
|
command diff --unified "$@" | colordiff --difftype diffu
|
|
else
|
|
command diff --unified "$@"
|
|
fi
|
|
}
|