From 64f5a453977ba0ad3a7e7cf41f4278616d7d0312 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Fri, 21 Jan 2022 14:39:35 +0100 Subject: [PATCH] Hide weak worktrees in the file finder Co-Authored-By: Nathan Sobo --- crates/project/src/project.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/project/src/project.rs b/crates/project/src/project.rs index 7ae502ad0c133f2a69e211e811a9b6d3db10c43d..6d65b3ab54f031f9ee432bd5393cac0f7a63ec86 100644 --- a/crates/project/src/project.rs +++ b/crates/project/src/project.rs @@ -1324,9 +1324,13 @@ impl Project { cancel_flag: &'a AtomicBool, cx: &AppContext, ) -> impl 'a + Future> { - let include_root_name = self.worktrees.len() > 1; - let candidate_sets = self + let worktrees = self .worktrees(cx) + .filter(|worktree| !worktree.read(cx).is_weak()) + .collect::>(); + let include_root_name = worktrees.len() > 1; + let candidate_sets = worktrees + .into_iter() .map(|worktree| CandidateSet { snapshot: worktree.read(cx).snapshot(), include_ignored,