Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Fix multibuffer scroll by reordering z-index of its elements

Kirill Bulatov764a2755e259
diff --git a/crates/editor2/src/element.rs b/crates/editor2/src/element.rs
index 294cc2c4e3e..9e1d8e641f0 100644
--- a/crates/editor2/src/element.rs
+++ b/crates/editor2/src/element.rs
@@ -2840,23 +2840,26 @@ impl Element for EditorElement {
}
self.paint_text(text_bounds, &mut layout, cx);
- cx.with_z_index(0, |cx| {
- self.paint_mouse_listeners(bounds, gutter_bounds, text_bounds, &layout, cx);
- });
-
- cx.with_z_index(1, |cx| self.paint_scrollbar(bounds, &mut layout, cx));
-
if !layout.blocks.is_empty() {
- cx.with_z_index(2, |cx| {
+ cx.with_z_index(0, |cx| {
cx.with_element_id(Some("editor_blocks"), |cx| {
self.paint_blocks(bounds, &mut layout, cx);
+ self.paint_mouse_listeners(
+ bounds,
+ gutter_bounds,
+ text_bounds,
+ &layout,
+ cx,
+ );
});
})
}
- cx.with_z_index(3, |cx| {
+ cx.with_z_index(1, |cx| {
self.paint_overlays(text_bounds, &mut layout, cx);
});
+
+ cx.with_z_index(2, |cx| self.paint_scrollbar(bounds, &mut layout, cx));
});
})
}