Overview
TheZepSyntax class provides syntax highlighting functionality for Zep text buffers. It runs asynchronously to analyze buffer text and apply syntax coloring based on keywords, identifiers, comments, and other language constructs.
ZepSyntax Class
Constructor
buffer- The ZepBuffer to apply syntax highlighting tokeywords- Set of language keywords to highlightidentifiers- Set of special identifiers to highlightflags- Syntax processing flags (see ZepSyntaxFlags)
Core Methods
GetSyntaxAt
index- Position in the buffer to query
SyntaxResult containing foreground/background colors and formatting
UpdateSyntax
Interrupt
Wait
GetProcessedChar
Color Conversion
ToBackgroundColor
ToForegroundColor
ZepSyntaxFlags
Flags that control syntax highlighting behavior:SyntaxData Structure
foreground- Text color (from theme)background- Background color (from theme)underline- Whether to underline the text
SyntaxResult Structure
SyntaxData with custom RGBA colors that override theme colors when set.
Implementing Custom Syntax Highlighters
To create a custom syntax highlighter:- Inherit from ZepSyntax:
- Override GetSyntaxAt for custom logic:
- Register with buffer:
