project panel: do not expand collapsed worktrees on "collapse all entries" (#10687)
Fixes #10597 Release Notes: - Fixed "project panel: collapse all entries" expanding collapsed worktrees.
This commit is contained in:
parent
4f2214e1d6
commit
b9e0269991
1 changed files with 4 additions and 1 deletions
|
@ -599,7 +599,10 @@ impl ProjectPanel {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn collapse_all_entries(&mut self, _: &CollapseAllEntries, cx: &mut ViewContext<Self>) {
|
pub fn collapse_all_entries(&mut self, _: &CollapseAllEntries, cx: &mut ViewContext<Self>) {
|
||||||
self.expanded_dir_ids.clear();
|
// By keeping entries for fully collapsed worktrees, we avoid expanding them within update_visible_entries
|
||||||
|
// (which is it's default behaviour when there's no entry for a worktree in expanded_dir_ids).
|
||||||
|
self.expanded_dir_ids
|
||||||
|
.retain(|_, expanded_entries| expanded_entries.is_empty());
|
||||||
self.update_visible_entries(None, cx);
|
self.update_visible_entries(None, cx);
|
||||||
cx.notify();
|
cx.notify();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue