helix
helix copied to clipboard
Visible whitespace only for selections
This is my first foray into rust so the code may not be idomatic
I'm not sure this makes sense or if it's too much of a micro optimization but we could not emit selection events when none of the WhitespaceRenderValues are for select. What do you think?
I'm not sure this makes sense or if it's too much of a micro optimization but we could not emit selection events when none of the WhitespaceRenderValues are for select. What do you think?
Sure, done in latest revision
It looks like whitespace ends up not getting rendered for the cursor. For that we may need to include ui.cursor
and ui.cursor.*
(but there's also ui.cursorline
so we can't use a starts-with check)
I've done some simplifications, this way we can avoid comparing spans against the set of selection scopes in most cases. I'm also thinking if we want to remove that render closure for a regular function
Thanks for the commits @archseer !
I've added a fix for ui.cursor
that @the-mikedavis found, and I've removed the inner render_whitespace
closure, so no more dynamic dispatch is required for each whitespace char rendered.
With #5420 merged this PR will need to be ported to the new text rendering in ui/document.rs
clsoing this one as stale as the rendering code has been entirely replaced. Thank you for contributing