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

Rehighlight TextEditor when Theme changes #2817

Open
4 tasks done
pml68 opened this issue Feb 25, 2025 · 0 comments
Open
4 tasks done

Rehighlight TextEditor when Theme changes #2817

pml68 opened this issue Feb 25, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@pml68
Copy link

pml68 commented Feb 25, 2025

Is your issue REALLY a bug?

  • My issue is indeed a bug!
  • I am not crazy! I will not fill out this form just to ask a question or request a feature. Pinky promise.

Is there an existing issue for this?

  • I have searched the existing issues.

Is this issue related to iced?

  • My hardware is compatible and my graphics drivers are up-to-date.

What happened?

When the application Theme changes, TextEditor is redrawn, but is not rehighlighted.

What is the expected behavior?

Since the to_format field of TextEditor::highlight_with accepts a closure with the Theme as an argument, and the Theme gets passed to to format fn in TextEditor::draw as well, I'd expect it to get rehighlighted when Theme changes. I'd open a PR, but I don't see a way to check if the Theme has actually changed, and I believe calling state.highlighter.borrow_mut().change_line(0) on each redraw isn't desired.

Version

master

Operating System

Linux

Do you have any log output?

@pml68 pml68 added the bug Something isn't working label Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant