mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Show .editorconfig errors in frontend (#21088)
If the user views the .editorconfig of the Repo, an the the .editorconfig contains error, those errors are now shown above the file.
This commit is contained in:
@@ -374,6 +374,11 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st
|
||||
ctx.Data["FileName"] = blob.Name()
|
||||
ctx.Data["RawFileLink"] = rawLink + "/" + util.PathEscapeSegments(ctx.Repo.TreePath)
|
||||
|
||||
if ctx.Repo.TreePath == ".editorconfig" {
|
||||
_, editorconfigErr := ctx.Repo.GetEditorconfig()
|
||||
ctx.Data["FileError"] = editorconfigErr
|
||||
}
|
||||
|
||||
buf := make([]byte, 1024)
|
||||
n, _ := util.ReadAtMost(dataRc, buf)
|
||||
buf = buf[:n]
|
||||
|
Reference in New Issue
Block a user