git-tools: fix git-diff-show
This commit is contained in:
parent
3f5dc9e1cb
commit
dcc054a785
|
@ -5,17 +5,17 @@ def git-diff-update-buffer %{ %sh{
|
|||
removed_lines=""
|
||||
git diff -U0 $kak_bufname | {
|
||||
line=0
|
||||
flags="0:red:."
|
||||
flags="0|red|."
|
||||
while read; do
|
||||
if [[ $REPLY =~ ^---.* ]]; then
|
||||
continue
|
||||
elif [[ $REPLY =~ ^@@.-[0-9]+(,[0-9]+)?.\+([0-9]+)(,[0-9]+)?.@@.* ]]; then
|
||||
line=${BASH_REMATCH[2]}
|
||||
elif [[ $REPLY =~ ^\+ ]]; then
|
||||
flags="$flags,$line:green:+"
|
||||
flags="$flags;$line|green|+"
|
||||
((line++))
|
||||
elif [[ $REPLY =~ ^\- ]]; then
|
||||
flags="$flags,$line:red:-"
|
||||
flags="$flags;$line|red|-"
|
||||
fi
|
||||
done
|
||||
echo "setb git_diff_flags '$flags'"
|
||||
|
|
Loading…
Reference in New Issue
Block a user