aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-06-02 15:22:48 -0400
committerDrew DeVault <sir@cmpwn.com>2019-06-02 15:22:48 -0400
commitd1ea18113533ae14818411725a692ffe4672e490 (patch)
treeecb22e0433e28656cd66218fe275523bc84e15e2
parent92b10fcef561074208b725e79c71c9a60e52b6b6 (diff)
downloadaerc-d1ea18113533ae14818411725a692ffe4672e490.tar.gz
hldiff.py: don't highlight -/+ in filenames
-rwxr-xr-xcontrib/hldiff.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/hldiff.py b/contrib/hldiff.py
index 716dbce3..9c816630 100755
--- a/contrib/hldiff.py
+++ b/contrib/hldiff.py
@@ -4,7 +4,7 @@ import sys
import re
ansi_escape = re.compile(r'\x1B\[[0-?]*[ -/]*[@-~]')
-stat_re = re.compile(r'(\+*)(\-*)')
+stat_re = re.compile(r'(| \d+ )(\+*)(\-*)')
lines_re = re.compile(r'@@ (-\d+,\d+ \+\d+,\d+) @@')
patch = sys.stdin.read().replace("\r\n", "\n")
@@ -33,6 +33,6 @@ for line in patch.split("\n"):
else:
if line.startswith(" ") and "|" in line and ("+" in line or "-" in line):
line = stat_re.sub(
- f'{Fore.GREEN}\\1{Fore.RED}\\2{Style.RESET_ALL}',
+ f'\\1{Fore.GREEN}\\2{Fore.RED}\\3{Style.RESET_ALL}',
line)
print(line)