Skip to content

Conversation

@CalebLarsen
Copy link
Contributor

helix_tui::widgets::Cell contains styled Text. In the case of a styled Cell with styled Text, the styled Text would override the style of the Cell. This led to errors where it seemed ui.text.directory had more priority than ui.menu.selected and ui.text.focus. This change also adds some tests from doc comments of Text and makes them actually tested.

Closes: #13768

Before/After

Autocomplete:
image
image
Picker:
image
image

`helix_tui::widgets::Cell` contains styled `Text`. In the case of a
styled `Cell` with styled `Text`, the styled `Text` would override the
style of the `Cell`. This led to errors where it seemed
`ui.text.directory` had more priority than `ui.menu.selected` and
`ui.text.focus`. This change also adds some tests from doc comments of
`Text` and makes them actually tested.

Closes: helix-editor#13768
@CalebLarsen CalebLarsen force-pushed the uitextdirectory-has-13768 branch from 30e6697 to 26efba0 Compare June 24, 2025 01:44
@the-mikedavis the-mikedavis merged commit a4d7804 into helix-editor:master Sep 15, 2025
7 checks passed
mi2ebi pushed a commit to mi2ebi/helix that referenced this pull request Sep 15, 2025
the-mikedavis added a commit that referenced this pull request Sep 16, 2025
This is a follow-up to #13776 to patch cell contents rather than
overwrite the contents. `ui.text.focus` might only set a modifier like
bold or italic. This should not become the only style in the cell: it
should be layered on top so that the cell has the directory and text
colors from the contents.
@RoloEdits
Copy link
Contributor

In working on #12369, this change now makes it a bit unclear how I can always style the icons color.

image

Above shows the icons color getting overridden with the focus.fg style, which in my theme is the normal text color. There isn't really a way now to built up spans with the styling wanted locally, without having the icons color overridden should there be a fg specified in ui.text.focus, which may want to be done for theme/visibility reasons.

Not really sure how to handle this.

mi2ebi pushed a commit to mi2ebi/helix that referenced this pull request Sep 22, 2025
This is a follow-up to helix-editor#13776 to patch cell contents rather than
overwrite the contents. `ui.text.focus` might only set a modifier like
bold or italic. This should not become the only style in the cell: it
should be layered on top so that the cell has the directory and text
colors from the contents.
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

Successfully merging this pull request may close these issues.

ui.text.directory has bigger priority than ui.menu.selected and ui.text.focus

4 participants