summaryrefslogtreecommitdiffstats
path: root/routers/repo/view.go
diff options
context:
space:
mode:
authorAndrey Nering <andrey.nering@gmail.com>2016-08-11 21:07:09 -0300
committer无闻 <u@gogs.io>2016-08-11 17:07:09 -0700
commitdbed39ba05fd498dad6cd3bf127c1f68056bf2ab (patch)
tree5f57a18ecdb444bbf52e583894fc38f2d8d50280 /routers/repo/view.go
parentaa1fc30b898a928ddafbfd0fddc47547c04f96e5 (diff)
downloadgitea-dbed39ba05fd498dad6cd3bf127c1f68056bf2ab.tar.gz
gitea-dbed39ba05fd498dad6cd3bf127c1f68056bf2ab.zip
On showing diff/file, use the tab_width specified on .editorconfig, if any (#3241)
Closes #3182
Diffstat (limited to 'routers/repo/view.go')
-rw-r--r--routers/repo/view.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/routers/repo/view.go b/routers/repo/view.go
index 9c495b701c..e685597a55 100644
--- a/routers/repo/view.go
+++ b/routers/repo/view.go
@@ -225,6 +225,12 @@ func Home(ctx *context.Context) {
ctx.Data["Username"] = userName
ctx.Data["Reponame"] = repoName
+ ec, err := ctx.Repo.GetEditorconfig()
+ if err != nil && !git.IsErrNotExist(err) {
+ ctx.Handle(500, "ErrGettingEditorconfig", err)
+ return
+ }
+ ctx.Data["Editorconfig"] = ec
var treenames []string
paths := make([]string, 0)