diff --git a/crates/editor/src/display_map.rs b/crates/editor/src/display_map.rs index 658239db9a575d4d13c2a6f7877e20fcd6e47673..00a48a9ab3d249850b9749d64267d8274e7eaa79 100644 --- a/crates/editor/src/display_map.rs +++ b/crates/editor/src/display_map.rs @@ -1006,11 +1006,6 @@ impl DisplayMap { &self.block_map.folded_buffers } - #[instrument(skip_all)] - pub(super) fn clear_folded_buffer(&mut self, buffer_id: language::BufferId) { - self.block_map.folded_buffers.remove(&buffer_id); - } - #[instrument(skip_all)] pub fn insert_creases( &mut self, diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index 5504305f86eb95dee000cec4099e366bbf86ffef..0d1238da21695738e4f6cedc54e172ad456c9bd6 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -24147,9 +24147,13 @@ impl Editor { self.display_map.update(cx, |display_map, cx| { display_map.invalidate_semantic_highlights(*buffer_id); display_map.clear_lsp_folding_ranges(*buffer_id, cx); - display_map.clear_folded_buffer(*buffer_id); }); } + + self.display_map.update(cx, |display_map, cx| { + display_map.unfold_buffers(removed_buffer_ids.iter().copied(), cx); + }); + jsx_tag_auto_close::refresh_enabled_in_any_buffer(self, multibuffer, cx); cx.emit(EditorEvent::ExcerptsRemoved { ids: ids.clone(),