From b673494f4df8d24e72587614c67260dc6b74603d Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Wed, 24 Apr 2024 17:47:25 -0400 Subject: [PATCH] Restore the previous styles for single-line editors (#10951) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR fixes a bug introduced in #10870 that caused editors used as single-line inputs to have the wrong text style. If this change was intentional for something relating to the new Assistant panel, we'll need to figure out a way to change it without breaking these other usages. ### Before Screenshot 2024-04-24 at 5 35 36 PM Screenshot 2024-04-24 at 5 35 46 PM ### After Screenshot 2024-04-24 at 5 36 14 PM Screenshot 2024-04-24 at 5 36 31 PM Release Notes: - Fixed a bug where some inputs were using the wrong font style (preview-only). --- crates/editor/src/editor.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index cfca895eff..a2fc4d67cf 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -10323,7 +10323,19 @@ impl Render for Editor { let settings = ThemeSettings::get_global(cx); let text_style = match self.mode { - EditorMode::SingleLine | EditorMode::AutoHeight { .. } => cx.text_style(), + EditorMode::SingleLine | EditorMode::AutoHeight { .. } => TextStyle { + color: cx.theme().colors().editor_foreground, + font_family: settings.ui_font.family.clone(), + font_features: settings.ui_font.features, + font_size: rems(0.875).into(), + font_weight: FontWeight::NORMAL, + font_style: FontStyle::Normal, + line_height: relative(settings.buffer_line_height.value()), + background_color: None, + underline: None, + strikethrough: None, + white_space: WhiteSpace::Normal, + }, EditorMode::Full => TextStyle { color: cx.theme().colors().editor_foreground, font_family: settings.buffer_font.family.clone(),