mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
add file line count info on UI (#8396)
Also reworked the header to remove the filename (which is redundant with the file path above) and made the header a flexbox with a monospace font. Fixes: https://github.com/go-gitea/gitea/issues/8170
This commit is contained in:
committed by
techknowlogick
parent
51fade4c44
commit
08896cd9f6
@@ -304,6 +304,8 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st
|
||||
|
||||
var output bytes.Buffer
|
||||
lines := strings.Split(fileContent, "\n")
|
||||
ctx.Data["NumLines"] = len(lines)
|
||||
|
||||
//Remove blank line at the end of file
|
||||
if len(lines) > 0 && lines[len(lines)-1] == "" {
|
||||
lines = lines[:len(lines)-1]
|
||||
|
Reference in New Issue
Block a user