highlight

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DebounceHighlightDuration = 65 * time.Millisecond

Manager handles debounced asynchronous syntax highlighting

Variables

This section is empty.

Functions

This section is empty.

Types

type EditorInterface

type EditorInterface interface {
	GetBuffer() buffer.Buffer
	GetCurrentTree() *sitter.Tree
	UpdateSyntaxHighlights(highlights highlighter.HighlightResult, tree *sitter.Tree)
}

EditorInterface defines methods needed from editor

type Manager

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

Manager handles syntax highlighting

func NewManager

func NewManager(editor EditorInterface, highlighter *highlighter.Highlighter, redrawFunc func()) *Manager

NewManager creates a new highlighting manager

func (*Manager) AccumulateEdit

func (m *Manager) AccumulateEdit(edit types.EditInfo)

AccumulateEdit adds an edit to the pending list and triggers/resets the timer

func (*Manager) Shutdown

func (m *Manager) Shutdown()

Shutdown cancels any pending/running tasks

Jump to

Keyboard shortcuts

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