Don't swallow stderr, don't update diff when not in git repo, use underlined ~ symbol

This commit is contained in:
Maxim Baz 2018-07-02 22:34:28 +02:00
parent a13e36b4b7
commit 551674875d
No known key found for this signature in database
GPG Key ID: 011FDC52DA839335

View File

@ -97,7 +97,8 @@ Available commands:\n add\n rm\n blame\n commit\n checkout\n diff\n hide-
}
update_diff() {
git --no-pager diff -U0 "$kak_buffile" 2>/dev/null | perl -e '
git rev-parse --show-toplevel >/dev/null 2>&1 || return
git --no-pager diff -U0 "$kak_buffile" | perl -e '
$flags = $ENV{"kak_timestamp"};
foreach $line (<STDIN>) {
if ($line =~ /@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))?/) {
@ -141,7 +142,7 @@ Available commands:\n add\n rm\n blame\n commit\n checkout\n diff\n hide-
$flags .= ":$line|\{blue\}~";
}
$last = $to_line + $to_count - 1;
$flags .= ":$last|\{blue\}~_";
$flags .= ":$last|\{blue+u\}~";
}
}
}