Filter brackets in wdiff highlights.
This commit is contained in:
parent
fb26ff880c
commit
2c68dfe11a
15
alias.zsh
15
alias.zsh
|
@ -91,12 +91,17 @@ if zstyle -t ':omz:alias:diff' color; then
|
||||||
}
|
}
|
||||||
|
|
||||||
function wdiff() {
|
function wdiff() {
|
||||||
if (( $+commands[wdiff] )) && (( $+commands[colordiff] )); then
|
if (( $+commands[wdiff] )); then
|
||||||
"$commands[diff]" --unified "$@" | "$commands[wdiff]" --diff-input --avoid-wraps | colordiff --difftype wdiff
|
"$commands[wdiff]" \
|
||||||
|
--avoid-wraps \
|
||||||
|
--start-delete="$(print -n $FG[red])" \
|
||||||
|
--end-delete="$(print -n $FG[none])" \
|
||||||
|
--start-insert="$(print -n $FG[green])" \
|
||||||
|
--end-insert="$(print -n $FG[none])" \
|
||||||
|
"$@" \
|
||||||
|
| sed 's/^\(@@\( [+-][[:digit:]]*,[[:digit:]]*\)\{2\} @@\)$/;5;6m\10m/g'
|
||||||
elif (( $+commands[git] )); then
|
elif (( $+commands[git] )); then
|
||||||
git --no-pager diff --color=auto --no-ext-diff --no-index --word-diff "$@"
|
git --no-pager diff --color=auto --no-ext-diff --no-index --color-words "$@"
|
||||||
elif (( $+commands[wdiff] )); then
|
|
||||||
"$commands[diff]" --unified "$@" | "$commands[wdiff]" --diff-input --avoid-wraps
|
|
||||||
else
|
else
|
||||||
print "zsh: command not found: $0" >&2
|
print "zsh: command not found: $0" >&2
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue