When source-filter is enabled, cgit currently will not display linenumbers in the tree view. This patch restores the linenumber function.
Unified · Split
| @@ -22,15 +22,6 @@ static void print_text_buffer(const char *name, char *buf, unsigned long size) · 21 unmodified lines | ||
| 22 | 22 | "<a class='no' id='n%1$d' name='n%1$d' href='#n%1$d'>%1$d</a>\n"; |
| 23 | 23 | |
| 24 | 24 | html("<table summary='blob content' class='blob'>\n"); |
| 25 | − if (ctx.repo->source_filter) { | |
| 26 | − html("<tr><td class='lines'><pre><code>"); | |
| 27 | − ctx.repo->source_filter->argv[1] = xstrdup(name); | |
| 28 | − cgit_open_filter(ctx.repo->source_filter); | |
| 29 | − write(STDOUT_FILENO, buf, size); | |
| 30 | − cgit_close_filter(ctx.repo->source_filter); | |
| 31 | − html("</code></pre></td></tr></table>\n"); | |
| 32 | − return; | |
| 33 | − } | |
| 34 | 25 | |
| 35 | 26 | html("<tr><td class='linenumbers'><pre>"); |
| 36 | 27 | idx = 0; |
| @@ -45,6 +36,17 @@ static void print_text_buffer(const char *name, char *buf, unsigned long size) · 8 unmodified lines | ||
| 45 | 36 | } |
| 46 | 37 | } |
| 47 | 38 | html("</pre></td>\n"); |
| 39 | + | |
| 40 | + if (ctx.repo->source_filter) { | |
| 41 | + html("<td class='lines'><pre><code>"); | |
| 42 | + ctx.repo->source_filter->argv[1] = xstrdup(name); | |
| 43 | + cgit_open_filter(ctx.repo->source_filter); | |
| 44 | + write(STDOUT_FILENO, buf, size); | |
| 45 | + cgit_close_filter(ctx.repo->source_filter); | |
| 46 | + html("</code></pre></td></tr></table>\n"); | |
| 47 | + return; | |
| 48 | + } | |
| 49 | + | |
| 48 | 50 | html("<td class='lines'><pre><code>"); |
| 49 | 51 | html_txt(buf); |
| 50 | 52 | html("</code></pre></td></tr></table>\n"); |