From 6565a4c8750f1e34814a8cc17bf20d086c205999 Mon Sep 17 00:00:00 2001 From: GeorchW Date: Sat, 4 Jan 2020 18:10:11 +0100 Subject: [PATCH] Show file name in window/tab title I've just encountered the problem that when browsing multiple files in different tabs, the tab title does not show the file name, which makes browsing a repository a happy game of memory for the entire family. This PR takes the fun away and should just display the file name in the title. --- internal/route/repo/view.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/route/repo/view.go b/internal/route/repo/view.go index 8b7defed6..ae91279fc 100644 --- a/internal/route/repo/view.go +++ b/internal/route/repo/view.go @@ -132,6 +132,7 @@ func renderFile(c *context.Context, entry *git.TreeEntry, treeLink, rawLink stri return } + c.Data["Title"] = blob.Name() + " - " + c.Data["Title"] c.Data["FileSize"] = blob.Size() c.Data["FileName"] = blob.Name() c.Data["HighlightClass"] = highlight.FileNameToHighlightClass(blob.Name())