Avoid showing selection strip on top of diagnostic headers

This commit is contained in:
Max Brunsfeld 2022-01-25 17:29:08 -08:00
parent 51c34ebcc2
commit 9b9fcf6927
2 changed files with 26 additions and 23 deletions

View file

@ -855,7 +855,7 @@ impl Element for EditorElement {
layout: &mut Self::LayoutState,
cx: &mut PaintContext,
) -> Self::PaintState {
if let Some(layout) = layout {
let layout = layout.as_mut()?;
cx.scene.push_layer(Some(bounds));
let gutter_bounds = RectF::new(bounds.origin(), layout.gutter_size);
@ -869,7 +869,12 @@ impl Element for EditorElement {
self.paint_gutter(gutter_bounds, visible_bounds, layout, cx);
}
self.paint_text(text_bounds, visible_bounds, layout, cx);
if !layout.blocks.is_empty() {
cx.scene.push_layer(Some(bounds));
self.paint_blocks(bounds, visible_bounds, layout, cx);
cx.scene.pop_layer();
}
cx.scene.pop_layer();
@ -878,9 +883,6 @@ impl Element for EditorElement {
gutter_bounds,
text_bounds,
})
} else {
None
}
}
fn dispatch_event(

View file

@ -258,6 +258,7 @@ path = { extends = "$text.2", size = 14, margin.left = 12 }
text_scale_factor = 0.857
[editor.diagnostic_header]
background = "$editor.background"
border = { width = 1, top = true, bottom = true, color = "$border.1" }
code = { extends = "$text.2", size = 14, margin.left = 10 }
icon_width_factor = 1.5