Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor issue collection #341

Open
3 of 5 tasks
dominikwilkowski opened this issue Mar 1, 2024 · 1 comment
Open
3 of 5 tasks

Editor issue collection #341

dominikwilkowski opened this issue Mar 1, 2024 · 1 comment

Comments

@dominikwilkowski
Copy link
Contributor

dominikwilkowski commented Mar 1, 2024

Happy to create an issue for each if that is better but didn't want to spam the issues

  • FIXED When in light mode the gutter paints the gutter number funny
    image
  • keyboard_navigatable is being ignored
  • I see no way to actually change anything besides color in the editor like caret width etc
  • FIXED Should probably also support placeholder()?
  • FIXED Line wrap seems to be off by a few pixel
    image

Moved issues

@MinusGix
Copy link
Member

MinusGix commented Mar 7, 2024

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_navigatable is 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.

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

No branches or pull requests

2 participants