Skip to content

Conversation

@shriramters
Copy link

This introduces support for live, "as-you-type" syntax highlighting to improve readability for structured text formats like SQL.

The main change is a new token-based rendering path. A new public highlight package provides the core Highlighter interface, and the internal textarea component has been refactored to be token-aware.

The new feature is exposed via a SetHighlighter() method on the bubbline.Editor and editline.Model.

This introduces support for live, "as-you-type" syntax highlighting
to improve readability for structured text formats like SQL.

The main change is a new token-based rendering path. A new public
`highlight` package provides the core `Highlighter` interface, and the
internal `textarea` component has been refactored to be token-aware.

The new feature is exposed via a `SetHighlighter()` method on the
`bubbline.Editor` and `editline.Model`.
@shriramters
Copy link
Author

I was looking to support syntax highlighting.

this is what it looks if you run the new example go run ./examples/live-highlight

live-highlighting.mp4

@shriramters
Copy link
Author

shriramters commented Jun 21, 2025

There also was some newLines logic going on (inside func (m Model) View()). that variable was simply being incremented and was never used anywhere so I removed it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant