aboutsummaryrefslogtreecommitdiffstats
path: root/ui-tree.c
diff options
context:
space:
mode:
authorFlorian Pritz2009-08-09 13:43:18 +0000
committerLars Hjemli2009-08-21 14:14:21 +0200
commit03389d6e67bfda5cb3ff1504db815f09715ec6f4 (patch)
treec3424f2206c8b577becb35038e45e6f5cf2b40a5 /ui-tree.c
parent6445a3ad0987ba66eef555c9caa3fc378f99ee22 (diff)
downloadcgit-03389d6e67bfda5cb3ff1504db815f09715ec6f4.tar.gz
cgit-03389d6e67bfda5cb3ff1504db815f09715ec6f4.tar.bz2
cgit-03389d6e67bfda5cb3ff1504db815f09715ec6f4.zip
ui-tree.c: show line numbers when highlighting
When source-filter is enabled, cgit currently will not display linenumbers in the tree view. This patch restores the linenumber function. Signed-off-by: Florian Pritz <bluewind@xssn.at> Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'ui-tree.c')
-rw-r--r--ui-tree.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/ui-tree.c b/ui-tree.c
index c608754..7bf2ad2 100644
--- a/ui-tree.c
+++ b/ui-tree.c
@@ -22,15 +22,6 @@ static void print_text_buffer(const char *name, char *buf, unsigned long size)
22 "<a class='no' id='n%1$d' name='n%1$d' href='#n%1$d'>%1$d</a>\n"; 22 "<a class='no' id='n%1$d' name='n%1$d' href='#n%1$d'>%1$d</a>\n";
23 23
24 html("<table summary='blob content' class='blob'>\n"); 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 html("<tr><td class='linenumbers'><pre>"); 26 html("<tr><td class='linenumbers'><pre>");
36 idx = 0; 27 idx = 0;
@@ -45,6 +36,17 @@ static void print_text_buffer(const char *name, char *buf, unsigned long size)
45 } 36 }
46 } 37 }
47 html("</pre></td>\n"); 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 html("<td class='lines'><pre><code>"); 50 html("<td class='lines'><pre><code>");
49 html_txt(buf); 51 html_txt(buf);
50 html("</code></pre></td></tr></table>\n"); 52 html("</code></pre></td></tr></table>\n");