Documentation
¶
Index ¶
- Constants
- type EditorInterface
- type Manager
- func (m *Manager) AccumulateEdit(edit types.EditInfo)
- func (m *Manager) ClearHighlights()
- func (m *Manager) GetCurrentTree() *sitter.Tree
- func (m *Manager) GetHighlights() []types.HighlightRegion
- func (m *Manager) GetHighlightsForLine(lineNum int) []types.StyledRange
- func (m *Manager) HasHighlights() bool
- func (m *Manager) HighlightSearchMatches(term string)
- func (m *Manager) Shutdown()
- func (m *Manager) UpdateHighlights(newHighlights hl.HighlightResult, newTree *sitter.Tree)
Constants ¶
View Source
const DebounceHighlightDuration = 75 * time.Millisecond
Debounce duration for highlighting updates
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EditorInterface ¶
type EditorInterface interface {
GetBuffer() buffer.Buffer // Still needed to get the initial bytes
GetCurrentTree() *sitter.Tree
UpdateSyntaxHighlights(highlights hl.HighlightResult, tree *sitter.Tree)
FilePath() string
}
EditorInterface defines methods the highlight manager needs from the editor.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles debounced asynchronous syntax highlighting.
func NewManager ¶
func NewManager(editor EditorInterface, highlighter *hl.Highlighter, redrawFunc func()) *Manager
NewManager creates a new highlight manager.
func (*Manager) AccumulateEdit ¶ added in v0.1.1
AccumulateEdit adds an edit to the pending list and triggers/resets the timer.
func (*Manager) ClearHighlights ¶
func (m *Manager) ClearHighlights()
ClearHighlights explicitly clears the syntax highlighting state.
func (*Manager) GetCurrentTree ¶
GetCurrentTree gets the current syntax tree (thread-safe).
func (*Manager) GetHighlights ¶
func (m *Manager) GetHighlights() []types.HighlightRegion
func (*Manager) GetHighlightsForLine ¶
func (m *Manager) GetHighlightsForLine(lineNum int) []types.StyledRange
GetHighlightsForLine gets syntax highlights for a line (thread-safe).
func (*Manager) HasHighlights ¶
func (*Manager) HighlightSearchMatches ¶
func (*Manager) Shutdown ¶ added in v0.1.1
func (m *Manager) Shutdown()
Shutdown cancels any pending/running tasks.
func (*Manager) UpdateHighlights ¶
func (m *Manager) UpdateHighlights(newHighlights hl.HighlightResult, newTree *sitter.Tree)
UpdateHighlights updates syntax highlights with thread safety.
Click to show internal directories.
Click to hide internal directories.