From ef689c5eee15270febef5ed02eda0d7960e85496 Mon Sep 17 00:00:00 2001 From: mgpinf Date: Sun, 9 Feb 2025 22:24:21 +0530 Subject: [PATCH] fix: display whitespace before reset of attributes in InputSelector (#6609) * fix: display whitespace before reset of attributes in InputSelector Display white space before reset of background and setting attributes to default in InputSelector. This is in order for whitespace after the option to be highlighted in the same background color as the currently selected option. The above mentioned points are currently reflected in ShowLauncherArgs but not in InputSelector. * fix: emit CRLF after attributes have changed Moving to the next line before the others are applied might lead to some wonky behavior in some edge cases. So to be on the safe side, emit CRLF after attributes have changed --- wezterm-gui/src/overlay/selector.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wezterm-gui/src/overlay/selector.rs b/wezterm-gui/src/overlay/selector.rs index cfc3db8ac..1e85fa103 100644 --- a/wezterm-gui/src/overlay/selector.rs +++ b/wezterm-gui/src/overlay/selector.rs @@ -155,11 +155,12 @@ impl SelectorState { line.resize(max_width, termwiz::surface::SEQ_ZERO); } changes.append(&mut line.changes(&attr)); + changes.push(Change::Text(" ".to_string())); if entry_idx == self.active_idx { changes.push(AttributeChange::Reverse(false).into()); } changes.push(Change::AllAttributes(CellAttributes::default())); - changes.push(Change::Text(" \r\n".to_string())); + changes.push(Change::Text("\r\n".to_string())); } if self.filtering || !self.filter_term.is_empty() {