Make --diff colours configurable

This commit is contained in:
George Christou
2016-02-17 10:10:07 +00:00
parent 8edcca0ef5
commit 56239ee347
2 changed files with 8 additions and 5 deletions

View File

@@ -138,12 +138,12 @@ class CallbackBase:
has_diff = False
for line in differ:
has_diff = True
if line.startswith('-'):
line = stringc(line, 'red')
elif line.startswith('+'):
line = stringc(line, 'green')
if line.startswith('+'):
line = stringc(line, C.COLOR_DIFF_ADD)
elif line.startswith('-'):
line = stringc(line, C.COLOR_DIFF_REMOVE)
elif line.startswith('@@'):
line = stringc(line, 'cyan')
line = stringc(line, C.COLOR_DIFF_LINES)
ret.append(line)
if has_diff:
ret.append('\n')