diff options
author | Johan Herland <johan@herland.net> | 2010-06-10 20:15:51 +0200 |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2010-06-19 13:00:07 +0200 |
commit | d20313e3daf855ee5d4808e050f54614c200d7b1 (patch) | |
tree | 5c462f3ba6ec97c0b099a309dfd0fa87d03fbc72 /ui-shared.c | |
parent | 6180e6169d6e87a3bea7e4da835dca17f93e5cfd (diff) | |
download | cgit-d20313e3daf855ee5d4808e050f54614c200d7b1.tar.gz cgit-d20313e3daf855ee5d4808e050f54614c200d7b1.tar.bz2 cgit-d20313e3daf855ee5d4808e050f54614c200d7b1.zip |
ui-diff: Add links to increase/decrease number of context lines in diffs
Add two links to the "Diffstat" line to show more/less context lines in the
generated diff.
To support this, cgit_commit_link() and cgit_diff_link() has learned to
preserve the ctx.qry.context variable.
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'ui-shared.c')
-rw-r--r-- | ui-shared.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/ui-shared.c b/ui-shared.c index e991799..c99bcec 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -341,6 +341,13 @@ void cgit_commit_link(char *name, const char *title, const char *class, if ((ctx.qry.ssdiff && !toggle_ssdiff) || (!ctx.qry.ssdiff && toggle_ssdiff)) { html(delim); html("ss=1"); + delim = "&"; + } + if (ctx.qry.context > 0 && ctx.qry.context != 3) { + html(delim); + html("context="); + htmlf("%d", ctx.qry.context); + delim = "&"; } html("'>"); html_txt(name); @@ -382,6 +389,13 @@ void cgit_diff_link(const char *name, const char *title, const char *class, if ((ctx.qry.ssdiff && !toggle_ssdiff) || (!ctx.qry.ssdiff && toggle_ssdiff)) { html(delim); html("ss=1"); + delim = "&"; + } + if (ctx.qry.context > 0 && ctx.qry.context != 3) { + html(delim); + html("context="); + htmlf("%d", ctx.qry.context); + delim = "&"; } html("'>"); html_txt(name); |