From e32aa95092b8df3600c29680e6092f2aa0a9d17b Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Fri, 20 Oct 2023 15:33:55 +0200 Subject: [PATCH] Touch up render function --- crates/rich_text/src/rich_text.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/crates/rich_text/src/rich_text.rs b/crates/rich_text/src/rich_text.rs index 0b13050777..0e5df3b816 100644 --- a/crates/rich_text/src/rich_text.rs +++ b/crates/rich_text/src/rich_text.rs @@ -81,17 +81,15 @@ impl RichText { }), ); } - if region.background_kind == Some(BackgroundKind::Code) { + if let Some(region_kind) = ®ion.background_kind { + let background = match region_kind { + BackgroundKind::Code => code_span_background_color, + BackgroundKind::Mention => self_mention_span_background_color, + } + .into(); cx.scene().push_quad(gpui::Quad { bounds, - background: Some(code_span_background_color), - border: Default::default(), - corner_radii: (2.0).into(), - }); - } else if region.background_kind == Some(BackgroundKind::Mention) { - cx.scene().push_quad(gpui::Quad { - bounds, - background: Some(self_mention_span_background_color), + background, border: Default::default(), corner_radii: (2.0).into(), });