From a24e5b128cfb706e4fa12f564a001997f8e8c6b9 Mon Sep 17 00:00:00 2001 From: Mikayla Maki Date: Mon, 15 Aug 2022 16:05:03 -0700 Subject: [PATCH] Fixed text rendering color based on focus --- crates/terminal/src/connected_el.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/terminal/src/connected_el.rs b/crates/terminal/src/connected_el.rs index 5f917c7f4e..69fc5f581f 100644 --- a/crates/terminal/src/connected_el.rs +++ b/crates/terminal/src/connected_el.rs @@ -647,6 +647,13 @@ impl Element for TerminalEl { let cursor_point = DisplayCursor::from(cursor.point, display_offset); let cursor_text = { let str_trxt = cursor_text.to_string(); + + let color = if self.focused { + terminal_theme.colors.background + } else { + terminal_theme.colors.foreground + }; + cx.text_layout_cache.layout_str( &str_trxt, text_style.font_size, @@ -654,7 +661,7 @@ impl Element for TerminalEl { str_trxt.len(), RunStyle { font_id: text_style.font_id, - color: terminal_theme.colors.background, + color, underline: Default::default(), }, )],