-rw-r--r-- | ui-diff.c | 5 | ||||
-rw-r--r-- | ui-shared.c | 10 |
2 files changed, 15 insertions, 0 deletions
@@ -166,16 +166,21 @@ void cgit_print_diffstat(const unsigned char *old_sha1, html(" ("); ctx.qry.context = (save_context > 0 ? save_context : 3) << 1; cgit_self_link("more", NULL, NULL, &ctx); html("/"); ctx.qry.context = (save_context > 3 ? save_context : 3) >> 1; cgit_self_link("less", NULL, NULL, &ctx); ctx.qry.context = save_context; html(" context)"); + html(" ("); + ctx.qry.ignorews = (ctx.qry.ignorews + 1) % 2; + cgit_self_link(ctx.qry.ignorews ? "ignore" : "show", NULL, NULL, &ctx); + ctx.qry.ignorews = (ctx.qry.ignorews + 1) % 2; + html(" whitespace changes)"); html("</div>"); html("<table summary='diffstat' class='diffstat'>"); max_changes = 0; cgit_diff_tree(old_sha1, new_sha1, inspect_filepair, prefix, ctx.qry.ignorews); for(i = 0; i<files; i++) print_fileinfo(&items[i]); html("</table>"); diff --git a/ui-shared.c b/ui-shared.c index c99bcec..f46c935 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -344,16 +344,21 @@ void cgit_commit_link(char *name, const char *title, const char *class, delim = "&"; } if (ctx.qry.context > 0 && ctx.qry.context != 3) { html(delim); html("context="); htmlf("%d", ctx.qry.context); delim = "&"; } + if (ctx.qry.ignorews) { + html(delim); + html("ignorews=1"); + delim = "&"; + } html("'>"); html_txt(name); html("</a>"); } void cgit_refs_link(const char *name, const char *title, const char *class, const char *head, const char *rev, const char *path) { @@ -392,16 +397,21 @@ void cgit_diff_link(const char *name, const char *title, const char *class, delim = "&"; } if (ctx.qry.context > 0 && ctx.qry.context != 3) { html(delim); html("context="); htmlf("%d", ctx.qry.context); delim = "&"; } + if (ctx.qry.ignorews) { + html(delim); + html("ignorews=1"); + delim = "&"; + } html("'>"); html_txt(name); html("</a>"); } void cgit_patch_link(const char *name, const char *title, const char *class, const char *head, const char *rev, const char *path) { |