Use replace blocks for patches (#20605)

Release Notes:

- N/A

---------

Co-authored-by: Max <max@zed.dev>
Co-authored-by: Richard <richard@zed.dev>
This commit is contained in:
Antonio Scandurra 2024-11-13 18:55:23 +01:00 committed by GitHub
parent 96deabfb78
commit 92613a8904
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 925 additions and 918 deletions

View file

@ -32,6 +32,7 @@ use std::{
cmp::Ordering,
mem,
ops::Range,
sync::Arc,
};
use theme::ActiveTheme;
pub use toolbar_controls::ToolbarControls;
@ -790,10 +791,11 @@ const DIAGNOSTIC_HEADER: &str = "diagnostic header";
fn diagnostic_header_renderer(diagnostic: Diagnostic) -> RenderBlock {
let (message, code_ranges) = highlight_diagnostic_message(&diagnostic, None);
let message: SharedString = message;
Box::new(move |cx| {
Arc::new(move |cx| {
let highlight_style: HighlightStyle = cx.theme().colors().text_accent.into();
h_flex()
.id(DIAGNOSTIC_HEADER)
.occlude()
.h(2. * cx.line_height())
.pl_10()
.pr_5()