mirror of
https://github.com/go-gitea/gitea
synced 2025-07-23 02:38:35 +00:00
On showing diff/file, use the tab_width specified on .editorconfig, if any (#3241)
Closes #3182
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user