author | Lars Hjemli <hjemli@gmail.com> | 2009-09-13 20:01:52 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2009-09-13 20:01:52 (UTC) |
commit | 5f12e45fe3338095916a444ff106dd9fc9991d84 (patch) (unidiff) | |
tree | 26b04e10b2ea277c09620bcf119eaa8f79e2fb88 /ui-tree.c | |
parent | 45c49d6cf4b819385dfee620a81e3cb095ed5cd1 (diff) | |
parent | 6638f40868ccf7806a9668560d3608324704c2b7 (diff) | |
download | cgit-5f12e45fe3338095916a444ff106dd9fc9991d84.zip cgit-5f12e45fe3338095916a444ff106dd9fc9991d84.tar.gz cgit-5f12e45fe3338095916a444ff106dd9fc9991d84.tar.bz2 |
Merge branch 'fp/linenumbers'
-rw-r--r-- | ui-tree.c | 25 |
1 files changed, 16 insertions, 9 deletions
@@ -23,14 +23,6 @@ static void print_text_buffer(const char *name, char *buf, unsigned long size) | |||
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 | ||
26 | if (ctx.cfg.enable_tree_linenumbers) { | ||
35 | html("<tr><td class='linenumbers'><pre>"); | 27 | html("<tr><td class='linenumbers'><pre>"); |
36 | idx = 0; | 28 | idx = 0; |
@@ -46,4 +38,19 @@ static void print_text_buffer(const char *name, char *buf, unsigned long size) | |||
46 | } | 38 | } |
47 | html("</pre></td>\n"); | 39 | html("</pre></td>\n"); |
40 | } | ||
41 | else { | ||
42 | html("<tr>\n"); | ||
43 | } | ||
44 | |||
45 | if (ctx.repo->source_filter) { | ||
46 | html("<td class='lines'><pre><code>"); | ||
47 | ctx.repo->source_filter->argv[1] = xstrdup(name); | ||
48 | cgit_open_filter(ctx.repo->source_filter); | ||
49 | write(STDOUT_FILENO, buf, size); | ||
50 | cgit_close_filter(ctx.repo->source_filter); | ||
51 | html("</code></pre></td></tr></table>\n"); | ||
52 | return; | ||
53 | } | ||
54 | |||
48 | html("<td class='lines'><pre><code>"); | 55 | html("<td class='lines'><pre><code>"); |
49 | html_txt(buf); | 56 | html_txt(buf); |