From mboxrd@z Thu Jan 1 00:00:00 1970 From: john at keeping.me.uk (John Keeping) Date: Mon, 18 Jun 2018 20:08:16 +0100 Subject: [PATCH v2 04/15] Add source page In-Reply-To: <152929065510.10419.14882888513835689446.stgit@mail.warmcat.com> References: <152928998685.10419.7869045561776063625.stgit@mail.warmcat.com> <152929065510.10419.14882888513835689446.stgit@mail.warmcat.com> Message-ID: <20180618190816.GP1922@john.keeping.me.uk> On Mon, Jun 18, 2018 at 10:57:35AM +0800, Andy Green wrote: > From: John Keeping > > We are about to introduce rendering of content for the tree view. This > source page will allow bypassing the renderer and accessing the content > of the current tree view. > > Signed-off-by: John Keeping > --- While testing this series, I noticed a slight deficiency in the source view in that nothing in the header is highlighted. The following fixup seems like the right thing to do. What do you think? -- >8 -- Subject: [PATCH] fixup! Add source page Signed-off-by: John Keeping --- ui-shared.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui-shared.c b/ui-shared.c index f358a68..c769ff8 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -1006,6 +1006,10 @@ void cgit_print_pageheader(void) if (ctx.qry.page && !strcmp(ctx.qry.page, "blame")) cgit_blame_link("blame", NULL, hc("blame"), ctx.qry.head, ctx.qry.sha1, ctx.qry.vpath); + else if (ctx.qry.page && !strcmp(ctx.qry.page, "source")) + cgit_source_link("tree", NULL, hc("source"), + ctx.qry.head, ctx.qry.sha1, + ctx.qry.vpath); else cgit_tree_link("tree", NULL, hc("tree"), ctx.qry.head, ctx.qry.sha1, ctx.qry.vpath); -- 2.17.1