Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

project_panel: Allow collapse all from workspace context (#32660)

Smit Barmasecb573172a3f0
diff --git a/crates/project_panel/src/project_panel.rs b/crates/project_panel/src/project_panel.rs
index 9e7dd9b5e3f..4243285e83b 100644
--- a/crates/project_panel/src/project_panel.rs
+++ b/crates/project_panel/src/project_panel.rs
@@ -260,6 +260,14 @@ pub fn init(cx: &mut App) {
setting.hide_gitignore = Some(!setting.hide_gitignore.unwrap_or(false));
})
});
+
+ workspace.register_action(|workspace, action: &CollapseAllEntries, window, cx| {
+ if let Some(panel) = workspace.panel::<ProjectPanel>(cx) {
+ panel.update(cx, |panel, cx| {
+ panel.collapse_all_entries(action, window, cx);
+ });
+ }
+ });
})
.detach();
}