From 970122f6d2d12e2dfaa5590da6b571e6cf5b7d13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20Vinyals=20Valdepe=C3=B1as?= Date: Sat, 20 Apr 2024 12:20:15 +0200 Subject: [PATCH] introduce custom style for trailing whitespace --- helix-term/src/ui/document.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/helix-term/src/ui/document.rs b/helix-term/src/ui/document.rs index e3af3a385..7ce597d6a 100644 --- a/helix-term/src/ui/document.rs +++ b/helix-term/src/ui/document.rs @@ -360,6 +360,7 @@ pub struct TextRenderer<'a> { pub surface: &'a mut Surface, pub text_style: Style, pub whitespace_style: Style, + pub trailing_whitespace_style: Style, pub indent_guide_char: String, pub indent_guide_style: Style, pub newline: String, @@ -410,6 +411,7 @@ impl<'a> TextRenderer<'a> { tab: regular_ws.tab, virtual_tab: regular_ws.virtual_tab, whitespace_style: theme.get("ui.virtual.whitespace"), + trailing_whitespace_style: theme.get("ui.virtual.trailing_whitespace"), indent_width, starting_indent: col_offset / indent_width as usize + (col_offset % indent_width as usize != 0) as usize @@ -506,7 +508,7 @@ impl<'a> TextRenderer<'a> { self.viewport.x + from as u16, self.viewport.y + position.row as u16, trailing_whitespace, - self.whitespace_style, + style.patch(self.trailing_whitespace_style), ); }, );