Diffstat (limited to 'ui-tree.c')
| -rw-r--r-- | ui-tree.c | 27 |
1 files changed, 11 insertions, 16 deletions
@@ -23,24 +23,19 @@ static void print_text_buffer(const char *name, char *buf, unsigned long size) 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); - while(idx < size - 1) { // skip absolute last newline - if (buf[idx] == '\n') - htmlf(numberfmt, ++lineno); - idx++; - } + html("<tr><td class='linenumbers'><pre>"); + idx = 0; + lineno = 0; + + if (size) { + htmlf(numberfmt, ++lineno); + while(idx < size - 1) { // skip absolute last newline + if (buf[idx] == '\n') + htmlf(numberfmt, ++lineno); + idx++; } - html("</pre></td>\n"); - } - else { - html("<tr>\n"); } + html("</pre></td>\n"); if (ctx.repo->source_filter) { html("<td class='lines'><pre><code>"); |