Diff options
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Print line number anchors through one helper
Diffstat (limited to 'source/ui-blame.c')
-rw-r--r--source/ui-blame.c14
1 file changed, 1 insertion, 13 deletions
diff --git a/source/ui-blame.c b/source/ui-blame.c
index 7254118..b07e57d 100644
--- a/source/ui-blame.c
+++ b/source/ui-blame.c
@@ -153,19 +153,7 @@ static void emit_entry_hash(struct blame_entry *ent)
static void emit_entry_linenumbers(struct blame_entry *ent)
{
- struct strbuf numbers = STRBUF_INIT;
- int lineno = ent->lno;
-
- while (lineno < ent->lno + ent->num_lines) {
- lineno++;
- strbuf_addf(&numbers, "<a id='n%d' href='#n%d'>%d</a>\n", lineno, lineno, lineno);
- if (numbers.len >= HTML_BATCH) {
- html_raw(numbers.buf, numbers.len);
- strbuf_reset(&numbers);
- }
- }
- html_raw(numbers.buf, numbers.len);
- strbuf_release(&numbers);
+ cgit_print_line_anchors((size_t)ent->lno + 1, (size_t)ent->lno + ent->num_lines);
}
static void emit_column(struct blame_scoreboard *sb, const char *class,