Commit 016d330f authored by Jacek Sowiński's avatar Jacek Sowiński Committed by Bram Schoenmakers

Fix coloring at the beginning of the output string

PrettyPrinterColorFilter mistakenly overwrote any colors at the
beginning with the priority color.
parent 36e4949b
......@@ -45,6 +45,9 @@ class PrettyPrinterColorFilter(PrettyPrinterFilter):
(r'(^|\s)(\w+:){1}(//\S+)', AbstractColor.LINK),
]
# color by priority
p_todo_str.set_color(0, priority_color)
for pattern, color in colors:
for match in re.finditer(pattern, p_todo_str.data):
p_todo_str.set_color(match.start(), color)
......@@ -52,8 +55,5 @@ class PrettyPrinterColorFilter(PrettyPrinterFilter):
p_todo_str.append('', AbstractColor.NEUTRAL)
# color by priority
p_todo_str.set_color(0, priority_color)
return p_todo_str
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment