mirror of
https://github.com/helix-editor/helix.git
synced 2025-10-06 00:13:28 +02:00
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.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user