mirror of
https://github.com/cheat/cheat.git
synced 2026-05-07 18:13:50 +02:00
chore(deps): bump github.com/alecthomas/chroma/v2 from 2.23.1 to 2.24.1
Bumps [github.com/alecthomas/chroma/v2](https://github.com/alecthomas/chroma) from 2.23.1 to 2.24.1. - [Release notes](https://github.com/alecthomas/chroma/releases) - [Commits](https://github.com/alecthomas/chroma/compare/v2.23.1...v2.24.1) --- updated-dependencies: - dependency-name: github.com/alecthomas/chroma/v2 dependency-version: 2.24.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
7
vendor/github.com/alecthomas/chroma/v2/styles/api.go
generated
vendored
7
vendor/github.com/alecthomas/chroma/v2/styles/api.go
generated
vendored
@@ -4,6 +4,7 @@ import (
|
||||
"embed"
|
||||
"io/fs"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/alecthomas/chroma/v2"
|
||||
)
|
||||
@@ -31,7 +32,7 @@ var Registry = func() map[string]*chroma.Style {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
registry[style.Name] = style
|
||||
registry[strings.ToLower(style.Name)] = style
|
||||
_ = r.Close()
|
||||
}
|
||||
return registry
|
||||
@@ -42,7 +43,7 @@ var Fallback = Registry["swapoff"]
|
||||
|
||||
// Register a chroma.Style.
|
||||
func Register(style *chroma.Style) *chroma.Style {
|
||||
Registry[style.Name] = style
|
||||
Registry[strings.ToLower(style.Name)] = style
|
||||
return style
|
||||
}
|
||||
|
||||
@@ -58,7 +59,7 @@ func Names() []string {
|
||||
|
||||
// Get named style, or Fallback.
|
||||
func Get(name string) *chroma.Style {
|
||||
if style, ok := Registry[name]; ok {
|
||||
if style, ok := Registry[strings.ToLower(name)]; ok {
|
||||
return style
|
||||
}
|
||||
return Fallback
|
||||
|
||||
Reference in New Issue
Block a user