zsh:diffcmds: Slight refactor & format adjustments
This commit is contained in:
@@ -727,16 +727,12 @@ diffcmds() {
|
||||
fi
|
||||
|
||||
# NOTE: `=()` is necessary since vimdiff is seeking the file. See zshexpn(1)
|
||||
[[ $diff_cmd = vimdiff ]] && ps_sub='=(' || ps_sub='<('
|
||||
[[ $diff_cmd = vimdiff ]] && ps_sub='=' || ps_sub='<'
|
||||
|
||||
final_cmd=("$diff_cmd")
|
||||
for arg in "$args[@]"; do
|
||||
# Substitute placeholder and wrap in process substitution
|
||||
final_cmd+=(
|
||||
"$ps_sub"
|
||||
"${(@)template//\%\%/$arg}"
|
||||
")"
|
||||
)
|
||||
final_cmd+=( "$ps_sub(${(@)template//\%\%/$arg})" )
|
||||
done
|
||||
eval "$final_cmd[@]"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user