mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-31 11:52:10 +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:
parent
80655026d2
commit
66e99d722a
23 changed files with 394 additions and 121 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue