project_panel: Support multiple items in RemoveFromProject
(#22455)
This makes the `RemoveFromProject` action to remove all marked entries in the project panel instead of just the selected one. Closes #22454 Release Notes: - Improved the `RemoveFromProject` action to remove all selected items.
This commit is contained in:
parent
3d8625f25c
commit
56017022c4
1 changed files with 2 additions and 2 deletions
|
@ -1995,8 +1995,8 @@ impl ProjectPanel {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn remove_from_project(&mut self, _: &RemoveFromProject, cx: &mut ViewContext<Self>) {
|
fn remove_from_project(&mut self, _: &RemoveFromProject, cx: &mut ViewContext<Self>) {
|
||||||
if let Some((worktree, _)) = self.selected_sub_entry(cx) {
|
for entry in self.effective_entries().iter() {
|
||||||
let worktree_id = worktree.read(cx).id();
|
let worktree_id = entry.worktree_id;
|
||||||
self.project
|
self.project
|
||||||
.update(cx, |project, cx| project.remove_worktree(worktree_id, cx));
|
.update(cx, |project, cx| project.remove_worktree(worktree_id, cx));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue