diff options
author | Andrey Nering <andrey.nering@gmail.com> | 2016-08-11 21:07:09 -0300 |
---|---|---|
committer | 无闻 <u@gogs.io> | 2016-08-11 17:07:09 -0700 |
commit | dbed39ba05fd498dad6cd3bf127c1f68056bf2ab (patch) | |
tree | 5f57a18ecdb444bbf52e583894fc38f2d8d50280 /routers/repo/pull.go | |
parent | aa1fc30b898a928ddafbfd0fddc47547c04f96e5 (diff) | |
download | gitea-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/pull.go')
-rw-r--r-- | routers/repo/pull.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/routers/repo/pull.go b/routers/repo/pull.go index 8fb7ae1831..77ee4bd348 100644 --- a/routers/repo/pull.go +++ b/routers/repo/pull.go @@ -371,6 +371,13 @@ func ViewPullFiles(ctx *context.Context) { return } + ec, err := ctx.Repo.GetEditorconfig() + if err != nil && !git.IsErrNotExist(err) { + ctx.Handle(500, "ErrGettingEditorconfig", err) + return + } + ctx.Data["Editorconfig"] = ec + headTarget := path.Join(pull.HeadUserName, pull.HeadRepo.Name) ctx.Data["IsSplitStyle"] = ctx.Query("style") == "split" ctx.Data["Username"] = pull.HeadUserName @@ -623,6 +630,13 @@ func CompareAndPullRequest(ctx *context.Context) { } } + ec, err := ctx.Repo.GetEditorconfig() + if err != nil && !git.IsErrNotExist(err) { + ctx.Handle(500, "ErrGettingEditorconfig", err) + return + } + ctx.Data["Editorconfig"] = ec + ctx.HTML(200, COMPARE_PULL) } |