mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-22 16:28:19 +02:00
Replace utils.Once with stdlib sync.OnceValue
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"kitty/tools/utils"
|
||||
"kitty/tools/utils/images"
|
||||
@@ -22,7 +23,7 @@ var _ = fmt.Print
|
||||
var _ = os.WriteFile
|
||||
|
||||
var ErrNoLexer = errors.New("No lexer available for this format")
|
||||
var DefaultStyle = utils.Once(func() *chroma.Style {
|
||||
var DefaultStyle = sync.OnceValue(func() *chroma.Style {
|
||||
// Default style generated by python style.py default pygments.styles.default.DefaultStyle
|
||||
// with https://raw.githubusercontent.com/alecthomas/chroma/master/_tools/style.py
|
||||
return styles.Register(chroma.MustNewStyle("default", chroma.StyleEntries{
|
||||
|
||||
Reference in New Issue
Block a user