Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-tui/src/widgets/table.rs')
| -rw-r--r-- | helix-tui/src/widgets/table.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/helix-tui/src/widgets/table.rs b/helix-tui/src/widgets/table.rs index 234df2e4..57f44883 100644 --- a/helix-tui/src/widgets/table.rs +++ b/helix-tui/src/widgets/table.rs @@ -38,8 +38,15 @@ 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 the `Style` of this cell. + pub fn set_style(&mut self, style: Style) { + self.style = style; + self.content.set_style(style); + } } impl<'a, T> From<T> for Cell<'a> @@ -453,6 +460,9 @@ impl Table<'_> { }; if is_selected { buf.set_style(table_row_area, self.highlight_style); + for cell in &mut table_row.cells { + cell.set_style(self.highlight_style); + } } let mut col = table_row_start_col; for (width, cell) in columns_widths.iter().zip(table_row.cells.iter()) { |