From dbb472d4c4f39051f06e26752cbb91c3e7e79827 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Tue, 16 Sep 2025 10:51:34 -0400 Subject: [PATCH] tui: Patch cell content style instead of overwriting 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. --- helix-tui/src/widgets/table.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/helix-tui/src/widgets/table.rs b/helix-tui/src/widgets/table.rs index 57f44883..5f4667b7 100644 --- a/helix-tui/src/widgets/table.rs +++ b/helix-tui/src/widgets/table.rs @@ -37,15 +37,14 @@ pub struct Cell<'a> { impl Cell<'_> { /// Set the `Style` of this cell. pub fn style(mut self, style: Style) -> Self { - self.style = style; - self.content.set_style(style); + self.set_style(style); self } /// Set the `Style` of this cell. pub fn set_style(&mut self, style: Style) { self.style = style; - self.content.set_style(style); + self.content.patch_style(style); } } -- 2.51.2