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>
This commit is contained in:

committed by
Lars Hjemli

parent
6180e6169d
commit
d20313e3da
14
ui-shared.c
14
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);
|
||||
|
Reference in New Issue
Block a user