From ded1c7012ca534b63c60a7559b3efef4455cb3b7 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Wed, 16 Apr 2025 22:31:04 -0600 Subject: [PATCH] Set diagnostic width based on ems (#28936) Closes #ISSUE Release Notes: - N/A *or* Added/Fixed/Improved ... --- crates/diagnostics/src/diagnostic_renderer.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/diagnostics/src/diagnostic_renderer.rs b/crates/diagnostics/src/diagnostic_renderer.rs index 5a0c97866b..039ec57b9a 100644 --- a/crates/diagnostics/src/diagnostic_renderer.rs +++ b/crates/diagnostics/src/diagnostic_renderer.rs @@ -15,7 +15,7 @@ use text::{AnchorRangeExt, Point}; use theme::ThemeSettings; use ui::{ ActiveTheme, AnyElement, App, Context, IntoElement, ParentElement, SharedString, Styled, - Window, div, px, + Window, div, }; use util::maybe; @@ -166,7 +166,8 @@ impl DiagnosticBlock { pub fn render_block(&self, editor: WeakEntity, bcx: &BlockContext) -> AnyElement { let cx = &bcx.app; let status_colors = bcx.app.theme().status(); - let max_width = px(600.); + + let max_width = bcx.em_width * 100.; let (background_color, border_color) = match self.severity { DiagnosticSeverity::ERROR => (status_colors.error_background, status_colors.error),