Skip to content

Commit dbb472d

Browse files
committed
tui: Patch cell content style instead of overwriting
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.
1 parent 46e3617 commit dbb472d

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

helix-tui/src/widgets/table.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,14 @@ pub struct Cell<'a> {
3737
impl Cell<'_> {
3838
/// Set the `Style` of this cell.
3939
pub fn style(mut self, style: Style) -> Self {
40-
self.style = style;
41-
self.content.set_style(style);
40+
self.set_style(style);
4241
self
4342
}
4443

4544
/// Set the `Style` of this cell.
4645
pub fn set_style(&mut self, style: Style) {
4746
self.style = style;
48-
self.content.set_style(style);
47+
self.content.patch_style(style);
4948
}
5049
}
5150

0 commit comments

Comments
 (0)