Editor issue collection
Happy to create an issue for each if that is better but didn't want to spam the issues
- [x] FIXED When in
lightmode the gutter paints the gutter number funny - [ ]
keyboard_navigatableis being ignored - [ ] I see no way to actually change anything besides color in the editor like caret width etc
- [x] FIXED Should probably also support
placeholder()? - [x] FIXED Line wrap seems to be off by a few pixel
Moved issues
- ~The cursor of the editor always blinks even when not in focus~
- Moved to #391
- ~The editor seems to ignore
request_focus()~- Moved to #392
- ~The editor ignores
stylefunction (should either remove it which is hard with Decorator or support it?)~- Moved to #393
- ~The Caret changes width depending if it's on a new line or has text~
- Moved to #394
- ~Not sure how you'd move focus away from the editor once you're in it with keyboard alone~
- Moved to #395
- ~
on_eventor any other event functions are not called. Instead theupdatefunction is used which is pretty inconsistent~- Moved to #396
The cursor of the editor always blinks even when not in focus The editor seems to ignore request_focus()
Yeah, it isn't handling FocusGained/FocusLost like the original text_input does. It should be changed to support that somehow.
I didn't think of those events when implementing it, so it should be simple to make the default implementation of 'should_blink` use that.
The editor ignores style function (should either remove it which is hard with Decorator or support it?)
Part of the issue is that we want more complex styling for some applications, like syntax highlighting, and you can't just style an individual piece of text or a line as a view.
But I think it should be possible to have SimpleStyling just default to the (for example) color given to the editorview, since it would merely have a constant color anyway. Though I'm not sure of the right way to pass that information to the Editor itself.
(I presume stuff like color, font family information, and background color are what you're referring to here, since it works with style functions like width_full)
keyboard_navigatableis being ignored
(TODO: i'm confused as to the details of this thing)
The Caret changes width depending if it's on a new line or has text
fun
I see no way to actually change anything besides color in the editor like caret width etc
I don't know everything people want to customize (admittedly didn't even think of caret width as one of those things), but a lot of it is just "hasn't been hooked up yet". Any other things that should be hooked up to be changeable?
(Though for some large changes like Lapce adding to gutter/scrollbar/etc, it turns into a 'just redeclare the view'. Though there's changes that can be made to make redeclarations easier, so it doesn't have to duplicate all the code in gutter or whatnot)
Not sure how you'd move focus away from the editor once you're in it with keyboard alone
Probably need some way to easily add basic keyboard handling events to the editor.
Should probably also support placeholder()?
Yep, shouldn't be hard. Edit: Done
on_event or any other event functions are not called. Instead the update function is used which is pretty inconsistent
Hm, yeah adding them as normal events would make some of that cleaner & more consistent.
Though I dislike having it as an event with all the others in that enum, since it is specific to the editor.
(Possibly .on_event should take a generic like .on_event::<PointerLeave> which would allow us to avoid the if let Some unwrapping even though it would always be the right event. Implementing that in a fancier way could allow arbitrary events)
on_event not being called for normal events shouldn't occur however, though I'm not immediately sure what would cause that. (Doing .on_event(EventListener::PointerDown doesn't seem to be ran if I use it on a text_editor view...)
Line wrap seems to be off by a few pixel
This is probably it not taking into account the scrollbar as part of the editor width.