mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 10:18:38 +00:00
upgrade gopkg.in/editorconfig/editorconfig-core-go.v1 (#8501)
editorconfig-core-go made breaking api changes and has recently released v2.1.1. This change consumes the new api and fixes up any breaking references.
This commit is contained in:
@@ -30,7 +30,7 @@ import (
|
||||
"code.gitea.io/gitea/services/gitdiff"
|
||||
mirror_service "code.gitea.io/gitea/services/mirror"
|
||||
|
||||
"gopkg.in/editorconfig/editorconfig-core-go.v1"
|
||||
"github.com/editorconfig/editorconfig-core-go/v2"
|
||||
)
|
||||
|
||||
// NewFuncMap returns functions for injecting to templates
|
||||
@@ -145,7 +145,11 @@ func NewFuncMap() []template.FuncMap {
|
||||
},
|
||||
"TabSizeClass": func(ec *editorconfig.Editorconfig, filename string) string {
|
||||
if ec != nil {
|
||||
def := ec.GetDefinitionForFilename(filename)
|
||||
def, err := ec.GetDefinitionForFilename(filename)
|
||||
if err != nil {
|
||||
log.Error("tab size class: getting definition for filename: %v", err)
|
||||
return "tab-size-8"
|
||||
}
|
||||
if def.TabWidth > 0 {
|
||||
return fmt.Sprintf("tab-size-%d", def.TabWidth)
|
||||
}
|
||||
|
Reference in New Issue
Block a user