Skip to content
Snippets Groups Projects
Commit cb8ca86e authored by Henning Glawe's avatar Henning Glawe
Browse files

allow for custom highlighting via 'highlighted' minfo field

parent 8ece1a39
No related branches found
No related tags found
No related merge requests found
......@@ -52,18 +52,22 @@ class Annotator(object):
matchlabel += minfo['which_re']
else:
matchlabel = 'no'
# highlight line
if minfo['coverageIgnore']:
highlighted = self.matchHighlighter.highlight_minfo(
minfo, linecolor=ANSI.FG_BLUE)
elif minfo['match']:
if minfo['matcher_does_nothing']:
# check if there is pre-highlighted data in minfo
highlighted = minfo.get('highlighted', None)
if highlighted is None:
# highlight line
if minfo['coverageIgnore']:
highlighted = self.matchHighlighter.highlight_minfo(
minfo, linecolor=ANSI.FG_MAGENTA)
minfo, linecolor=ANSI.FG_BLUE)
elif minfo['match']:
if minfo['matcher_does_nothing']:
highlighted = self.matchHighlighter.highlight_minfo(
minfo, linecolor=ANSI.FG_MAGENTA)
else:
highlighted = self.matchHighlighter.highlight_minfo(minfo)
else:
highlighted = self.matchHighlighter.highlight_minfo(minfo)
else:
highlighted = minfo['fInLine']
highlighted = minfo['fInLine']
# shorted matcher- and source file names
name = minfo['matcherName'][-self._formatNameWidth:] if minfo['matcherName'] else 'UNNAMED'
defFile = minfo['defFile'][-self._formatSourceWidth:]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment