Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Fix inlay hint cleanup on excerpts removal (#40738)
Kirill Bulatov32a442d5229f
diff --git a/crates/editor/src/display_map.rs b/crates/editor/src/display_map.rsindex b3d642f60ea..aad62e0debd 100644--- a/crates/editor/src/display_map.rs+++ b/crates/editor/src/display_map.rs@@ -594,7 +594,11 @@ impl DisplayMap {self.block_map.read(snapshot, edits);}- pub fn remove_inlays_for_excerpts(&mut self, excerpts_removed: &[ExcerptId]) {+ pub fn remove_inlays_for_excerpts(+ &mut self,+ excerpts_removed: &[ExcerptId],+ cx: &mut Context<Self>,+ ) {let to_remove = self.inlay_map.current_inlays()@@ -606,7 +610,7 @@ impl DisplayMap {}}).collect::<Vec<_>>();- self.inlay_map.splice(&to_remove, Vec::new());+ self.splice_inlays(&to_remove, Vec::new(), cx);}fn tab_size(buffer: &Entity<MultiBuffer>, cx: &App) -> NonZeroU32 {diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rsindex 20ebff811d5..6923e5ca5bc 100644--- a/crates/editor/src/editor.rs+++ b/crates/editor/src/editor.rs@@ -5298,8 +5298,8 @@ impl Editor {{self.splice_inlays(&to_remove, to_insert, cx);}- self.display_map.update(cx, |display_map, _| {- display_map.remove_inlays_for_excerpts(&excerpts_removed)+ self.display_map.update(cx, |display_map, cx| {+ display_map.remove_inlays_for_excerpts(&excerpts_removed, cx)});return;}