]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-diff.c
ui-diff: Add link to ignore/show whitespace changes in diffs
[ps-cgit] / ui-diff.c
index 1656b77b845ebbb7e0c9da69170458ca08859fce..0dcabe90b9931e4b53e009a89b9853dcf3ab8c76 100644 (file)
--- a/ui-diff.c
+++ b/ui-diff.c
@@ -171,6 +171,11 @@ void cgit_print_diffstat(const unsigned char *old_sha1,
        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;