From 7eac6d242ced63b2c839d653af60fcf902f44c01 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Thu, 13 Nov 2025 10:13:54 +0100 Subject: [PATCH] diagnostics: Workaround weird panic in `update_path_excerpts` (#42602) Fixes ZED-36P Patching this over for now until I can figure out the cause of this Release Notes: - Fixed panic in diagnostics pane --- crates/multi_buffer/src/path_key.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/multi_buffer/src/path_key.rs b/crates/multi_buffer/src/path_key.rs index 09d098ea0727906500b37acd8f694f569fea75e2..56f28d26642439f7869bad714a8b3191dd4edbec 100644 --- a/crates/multi_buffer/src/path_key.rs +++ b/crates/multi_buffer/src/path_key.rs @@ -410,6 +410,8 @@ impl MultiBuffer { } self.insert_excerpts_with_ids_after(insert_after, buffer, to_insert, cx); + // todo(lw): There is a logic bug somewhere that causes the to_remove vector to be not ordered correctly + to_remove.sort_by_cached_key(|&id| snapshot.excerpt_locator_for_id(id)); self.remove_excerpts(to_remove, cx); if excerpt_ids.is_empty() { self.excerpts_by_path.remove(&path);