File tree Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -109,9 +109,11 @@ AbstractWriter* createWriter(
109
109
110
110
struct CtxEventDetector ::Private {
111
111
boost::regex reAnyCtxLine;
112
+ boost::regex reKeyCtxLine;
112
113
113
114
Private ():
114
- reAnyCtxLine (" ^ *[0-9]+\\ |(?:->)? .*$" )
115
+ reAnyCtxLine (" ^ *[0-9]+\\ |(?:->)? .*$" ),
116
+ reKeyCtxLine (" ^ *[0-9]+\\ |-> .*$" )
115
117
{
116
118
}
117
119
};
@@ -129,3 +131,8 @@ bool CtxEventDetector::isAnyCtxLine(const DefEvent &evt) const {
129
131
return (evt.event == " #" )
130
132
&& boost::regex_match (evt.msg , d->reAnyCtxLine );
131
133
}
134
+
135
+ bool CtxEventDetector::isKeyCtxLine (const DefEvent &evt) const {
136
+ return (evt.event == " #" )
137
+ && boost::regex_match (evt.msg , d->reKeyCtxLine );
138
+ }
Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ class CtxEventDetector {
78
78
~CtxEventDetector ();
79
79
80
80
bool isAnyCtxLine (const DefEvent &evt) const ;
81
+ bool isKeyCtxLine (const DefEvent &evt) const ;
81
82
82
83
private:
83
84
struct Private ;
Original file line number Diff line number Diff line change @@ -74,9 +74,17 @@ void CovWriter::handleDef(const Defect &def) {
74
74
if (0 < evt.column )
75
75
str << evt.column << " :" ;
76
76
77
- if (evt.event == " #" )
77
+ if (evt.event == " #" ) {
78
78
str << d->cw .setColor (C_LIGHT_CYAN) << " #" ;
79
79
80
+ static CtxEventDetector detector;
81
+ if (detector.isAnyCtxLine (evt)) {
82
+ const EColor color = detector.isKeyCtxLine (evt)
83
+ ? C_WHITE
84
+ : C_DARK_GRAY;
85
+ str << d->cw .setColor (color);
86
+ }
87
+ }
80
88
else {
81
89
str << " " ;
82
90
if (!evt.event .empty ())
You can’t perform that action at this time.
0 commit comments