On showing diff/file, use the tab_width specified on .editorconfig, if any (#3241)
Closes #3182
This commit is contained in:
parent
aa1fc30b89
commit
dbed39ba05
9 changed files with 137 additions and 2 deletions
|
@ -174,6 +174,13 @@ func Diff(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.Data["CommitID"] = commitID
|
||||
ctx.Data["IsSplitStyle"] = ctx.Query("style") == "split"
|
||||
ctx.Data["Username"] = userName
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue