From db68fbcd321b2d6a8d1596a045176e19660f9d68 Mon Sep 17 00:00:00 2001 From: Sergei Shulepov Date: Fri, 27 Dec 2024 18:33:10 +0100 Subject: [PATCH] project panel: support plural in `RemoveFromProject` This makes the `RemoveFromProject` action to remove all marked entries in the project panel instead of just the selected one. Fixes #22454 --- crates/project_panel/src/project_panel.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/project_panel/src/project_panel.rs b/crates/project_panel/src/project_panel.rs index f03bbe8468904..16801a6fbb35d 100644 --- a/crates/project_panel/src/project_panel.rs +++ b/crates/project_panel/src/project_panel.rs @@ -1966,8 +1966,8 @@ impl ProjectPanel { } fn remove_from_project(&mut self, _: &RemoveFromProject, cx: &mut ViewContext) { - if let Some((worktree, _)) = self.selected_sub_entry(cx) { - let worktree_id = worktree.read(cx).id(); + for entry in self.marked_entries().iter() { + let worktree_id = entry.worktree_id; self.project .update(cx, |project, cx| project.remove_worktree(worktree_id, cx)); }