From 10a3ad078ca6c8c798f7a69aea620da4fb599e9e Mon Sep 17 00:00:00 2001 From: "gcp-cherry-pick-bot[bot]" <98988430+gcp-cherry-pick-bot[bot]@users.noreply.github.com> Date: Fri, 4 Apr 2025 09:18:56 -0400 Subject: [PATCH] Clear path-based excerpt data properly (cherry-pick #28026) (#28082) Cherry-picked Clear path-based excerpt data properly (#28026) Follow-up of https://github.com/zed-industries/zed/pull/27893 Release Notes: - N/A Co-authored-by: Conrad Irwin Co-authored-by: Kirill Bulatov Co-authored-by: Conrad Irwin --- crates/multi_buffer/src/multi_buffer.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/multi_buffer/src/multi_buffer.rs b/crates/multi_buffer/src/multi_buffer.rs index 49ea962341f7424fd0f443d5bed0c83446b2c8de..c8bb9b49bf4443ce679ac941b615975609289739 100644 --- a/crates/multi_buffer/src/multi_buffer.rs +++ b/crates/multi_buffer/src/multi_buffer.rs @@ -2041,6 +2041,8 @@ impl MultiBuffer { self.sync(cx); let ids = self.excerpt_ids(); self.buffers.borrow_mut().clear(); + self.excerpts_by_path.clear(); + self.paths_by_excerpt.clear(); let mut snapshot = self.snapshot.borrow_mut(); let start = ExcerptOffset::new(0); let prev_len = ExcerptOffset::new(snapshot.excerpts.summary().text.len); @@ -2049,6 +2051,7 @@ impl MultiBuffer { snapshot.is_dirty = false; snapshot.has_deleted_file = false; snapshot.has_conflict = false; + snapshot.replaced_excerpts.clear(); self.sync_diff_transforms( &mut snapshot,