Community contribution: Code editor prototype with syntax highlighting (Rust + Slint) #10929
Unanswered
lpmwfx
asked this question in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Slint team,
I wanted to share a working prototype I built to explore whether Slint could power a full code editor with syntax highlighting — something that felt like a gap in the current widget ecosystem.
What it demonstrates:
for-loops: all tokens from all lines are flattened into a single model, each token carrying its line index and x-offset so it can be absolutely positioned inside aFlickableRectangle+animate opacity)(),[],{},"",'',``FlickableWhy this matters for Slint:
A code editor widget (or at least an official example showing this pattern) feels like a natural missing piece for a GUI toolkit targeting developers. The flat-token approach is non-obvious but works well — it might be worth documenting or even building into an official
CodeEditorcomponent.Repo:
https://github.com/lpmwfx/slint-codeeditor
Feel free to use it however you like — borrow the approach, adapt the code, or use it as a reference. No strings attached.
Best regards,
Lars — Denmark
Beta Was this translation helpful? Give feedback.
All reactions