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.
pull/5896/head
GeorchW 2020-01-04 18:10:11 +01:00 committed by GitHub
parent 76b87b1bbd
commit 6565a4c875
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -132,6 +132,7 @@ func renderFile(c *context.Context, entry *git.TreeEntry, treeLink, rawLink stri
return return
} }
c.Data["Title"] = blob.Name() + " - " + c.Data["Title"]
c.Data["FileSize"] = blob.Size() c.Data["FileSize"] = blob.Size()
c.Data["FileName"] = blob.Name() c.Data["FileName"] = blob.Name()
c.Data["HighlightClass"] = highlight.FileNameToHighlightClass(blob.Name()) c.Data["HighlightClass"] = highlight.FileNameToHighlightClass(blob.Name())