diff --git a/routers/web/repo/view.go b/routers/web/repo/view.go index cdfb4b9906..65c8ab92cf 100644 --- a/routers/web/repo/view.go +++ b/routers/web/repo/view.go @@ -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] diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl index f06521046e..2b4f279cb6 100644 --- a/templates/repo/view_file.tmpl +++ b/templates/repo/view_file.tmpl @@ -1,4 +1,11 @@
+ {{- if .FileError}} +
+
+
{{.FileError}}
+
+
+ {{end}}

{{if .ReadmeInList}}