1
1
Fork 0

zshrc: Make colordiff fallback work on MSYS2

This commit is contained in:
Jonathan Schleifer 2020-05-24 13:30:32 +00:00
parent 9ea5a40c70
commit 7f64e66c17

9
zshrc
View file

@ -210,10 +210,11 @@ if which fossil &>/dev/null; then
if which colordiff &>/dev/null; then
fossil diff -N "$@" | colordiff | less -FRX
else
fossil diff -N "$@" |
sed "s/^+.*$/$(tput setaf 2)&$(tput sgr0)/" |
sed "s/^-.*$/$(tput setaf 1)&$(tput sgr0)/" |
less -FRX
red="$(tput setaf 1)"
green="$(tput setaf 2)"
reset="$(tput sgr0)"
fossil diff -N "$@" | sed "s/^+.*$/$green&$reset/" |
sed "s/^-.*$/$red&$reset/" | less -FRX
fi
}
fi