From 08dfcba68a73b9ce337bec7950f7a43236832c2d Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Wed, 15 Nov 2023 20:02:35 +0100 Subject: [PATCH] Fix panic when painting blocks --- crates/editor2/src/element.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/editor2/src/element.rs b/crates/editor2/src/element.rs index eaaa2d2a2f..4d9a516f2b 100644 --- a/crates/editor2/src/element.rs +++ b/crates/editor2/src/element.rs @@ -2464,7 +2464,9 @@ impl Element for EditorElement { self.paint_text(text_bounds, &mut layout, editor, cx); if !layout.blocks.is_empty() { - self.paint_blocks(bounds, &mut layout, editor, cx); + cx.with_element_id(Some("editor_blocks"), |cx| { + self.paint_blocks(bounds, &mut layout, editor, cx); + }) } }); });