-rw-r--r-- | ui-tree.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -20,12 +20,13 @@ static void print_text_buffer(const char *name, char *buf, unsigned long size) unsigned long lineno, idx; const char *numberfmt = "<a class='no' id='n%1$d' name='n%1$d' href='#n%1$d'>%1$d</a>\n"; html("<table summary='blob content' class='blob'>\n"); + if (ctx.cfg.linenumbers) { html("<tr><td class='linenumbers'><pre>"); idx = 0; lineno = 0; if (size) { htmlf(numberfmt, ++lineno); @@ -33,12 +34,16 @@ static void print_text_buffer(const char *name, char *buf, unsigned long size) if (buf[idx] == '\n') htmlf(numberfmt, ++lineno); idx++; } } html("</pre></td>\n"); + } + else { + html("<tr>\n"); + } if (ctx.repo->source_filter) { html("<td class='lines'><pre><code>"); ctx.repo->source_filter->argv[1] = xstrdup(name); cgit_open_filter(ctx.repo->source_filter); write(STDOUT_FILENO, buf, size); |