chroma

package
v0.1.1-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2026 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SyntaxMap = map[chroma.TokenType]uint32{
	chroma.Comment:        0x555753,
	chroma.Keyword:        0x729FCF,
	chroma.String:         0x8AE234,
	chroma.Number:         0xAD7FA8,
	chroma.Operator:       0xFFFFFF,
	chroma.NameFunction:   0xFCE94F,
	chroma.NameVariable:   0xEEEEEC,
	chroma.GenericHeading: 0x729FCF,
}

SyntaxMap links Chroma token types to f4 colors

Functions

func GetSyntaxAttr

func GetSyntaxAttr(t chroma.TokenType, baseAttr uint64) uint64

GetSyntaxAttr returns vtui attributes for a specific token type

Types

type ChromaHighlighter

type ChromaHighlighter struct {
	// contains filtered or unexported fields
}

ChromaHighlighter implements vtui.Highlighter.

func (*ChromaHighlighter) Highlight

func (c *ChromaHighlighter) Highlight(line string, prevState any, baseAttr uint64) ([]uint64, any)

type ChromaProvider

type ChromaProvider struct{}

ChromaProvider implements vtui.HighlighterProvider using the chroma library.

func (*ChromaProvider) Create

func (p *ChromaProvider) Create(filename string, content string) vtui.Highlighter

func (*ChromaProvider) Match

func (p *ChromaProvider) Match(filename string, content string) bool

func (*ChromaProvider) Name

func (p *ChromaProvider) Name() string

type Plugin

type Plugin struct{}

Plugin is the internal plugin wrapper for the Chroma syntax highlighter.

func (*Plugin) Close

func (p *Plugin) Close() error

func (*Plugin) GetName

func (p *Plugin) GetName() string

func (*Plugin) Init

func (p *Plugin) Init(api vfs.HostAPI) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL