Skip to content

Commit 048ad9c

Browse files
committed
Highlight current line number
Otherwise it's hard to visually identify part of the code you jumped to.
1 parent 27ba122 commit 048ad9c

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

web/file.ecpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ along with uncov. If not, see <http://www.gnu.org/licenses/>.
181181
% file->getCoverage());
182182
% int line = 0;
183183
% for (std::string s; std::getline(oss, s); ) {
184-
<a name="l<$std::to_string(++line)$>"></a><$$ s $>
184+
<span id="l<$std::to_string(++line)$>" class="line"><$$ s $></span>
185185
% }
186186
</pre>
187187

web/style.css

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ pre {
8686
line-height: 125%;
8787
}
8888

89-
pre > span.lineno {
89+
pre > span.line > span.lineno {
9090
font-weight: bold;
9191
padding-right: 5px;
9292
}
@@ -95,6 +95,12 @@ a > span.lineno {
9595
font-weight: bold;
9696
}
9797

98+
span.line:target {
99+
background-color: #ff4;
100+
display: inline-block;
101+
width: 100%;
102+
}
103+
98104
span.hitcount {
99105
padding-left: 3px;
100106
padding-right: 3px;

0 commit comments

Comments
 (0)