-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Fix precedence of ui.virtual.whitespace #8750
Fix precedence of ui.virtual.whitespace #8750
Conversation
This allows for more control over the order (precedence) in which styles are patched in the rendering phase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks pretty good, this will also help with some other stuff in the future. I may be able to use this to finally fix a bunch of other highlight issues in the future
I pushed a commit addressing the points you made. |
I think the label "waiting-on-author" can be removed. |
not sure if there is anything special about this, but when I built with this commit merged to master I lose all syntax highlighting. If I go back one commit to 47b6c4b and build syntax highlighting is back. This is built on Windows 11 and running in Windows Terminal |
theme, | ||
}; | ||
let mut overlay_styles = StyleIter { | ||
text_style: renderer.text_style, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using render.text_style
is wrong here it will set the whole document to the text colour as the overlay is patched last, this should just be Style::default
so if there is no style here we don't override the past text highlighting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see StyleIter for why it will highlight all the text the default text color:
helix/helix-term/src/ui/document.rs
Lines 64 to 66 in 41b307b
.fold(self.text_style, |acc, span| { | |
acc.patch(self.theme.highlight(span.0)) | |
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking into this more deeply, this text_style is set based on the given ui.text
scope. The documentation about this says "Command prompts, popup text, etc.", but as this is really the default text style that is used, we should probably change that description.
Reverting. I thought this PR was properly tested. |
My apologies for missing this. I had been using this patch for weeks without problems. It seems to be that the themes I was using did not expose this issue. But other themes, like the default theme, do expose this issue. I will fix the problem and make sure to test with a wider variety of themes. EDIT: this is probably related to whether the theme sets the |
This reverts commit 41b307b.
* Revert "Revert "Fix precedence of ui.virtual.whitespace (helix-editor#8750)"" This reverts commit 811d62d. * Fix ui.text overwriting the syntax highlighting Adjust ui.text description
This reverts commit 41b307b.
* Revert "Revert "Fix precedence of ui.virtual.whitespace (helix-editor#8750)"" This reverts commit 811d62d. * Fix ui.text overwriting the syntax highlighting Adjust ui.text description
This reverts commit 41b307b.
* Revert "Revert "Fix precedence of ui.virtual.whitespace (helix-editor#8750)"" This reverts commit 811d62d. * Fix ui.text overwriting the syntax highlighting Adjust ui.text description
This reverts commit 41b307b.
* Revert "Revert "Fix precedence of ui.virtual.whitespace (helix-editor#8750)"" This reverts commit 811d62d. * Fix ui.text overwriting the syntax highlighting Adjust ui.text description
This fixes the first half of #5675, namely the whitespace case.
Based on the suggestions by @pascalkuthe in #8733
Is this along the lines of what you envisioned?