From c6cc0108ca7738023b45e0eeac0fa2390532dd93 Mon Sep 17 00:00:00 2001 From: Mitja Felicijan Date: Fri, 25 Oct 2024 00:47:47 +0200 Subject: Added vendor lock on deps --- .../github.com/alecthomas/chroma/v2/styles/api.go | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 vendor/github.com/alecthomas/chroma/v2/styles/api.go (limited to 'vendor/github.com/alecthomas/chroma/v2/styles/api.go') diff --git a/vendor/github.com/alecthomas/chroma/v2/styles/api.go b/vendor/github.com/alecthomas/chroma/v2/styles/api.go new file mode 100644 index 0000000..8c0dbe0 --- /dev/null +++ b/vendor/github.com/alecthomas/chroma/v2/styles/api.go @@ -0,0 +1,37 @@ +package styles + +import ( + "sort" + + "github.com/alecthomas/chroma/v2" +) + +// Registry of Styles. +var Registry = map[string]*chroma.Style{} + +// Fallback style. Reassign to change the default fallback style. +var Fallback = SwapOff + +// Register a chroma.Style. +func Register(style *chroma.Style) *chroma.Style { + Registry[style.Name] = style + return style +} + +// Names of all available styles. +func Names() []string { + out := []string{} + for name := range Registry { + out = append(out, name) + } + sort.Strings(out) + return out +} + +// Get named style, or Fallback. +func Get(name string) *chroma.Style { + if style, ok := Registry[name]; ok { + return style + } + return Fallback +} -- cgit v1.2.3