Fix a bug where directories were not matching in the fuzzy matcher, when query contains the worktree root name (#16242)
Release Notes: - N/A Co-authored-by: Max <max@zed.dev>
This commit is contained in:
@@ -32,7 +32,7 @@ use futures::{
|
||||
stream::FuturesUnordered,
|
||||
AsyncWriteExt, Future, FutureExt, StreamExt,
|
||||
};
|
||||
use fuzzy::CharBag;
|
||||
|
||||
use git::{blame::Blame, repository::GitRepository};
|
||||
use globset::{Glob, GlobSet, GlobSetBuilder};
|
||||
use gpui::{
|
||||
@@ -11030,19 +11030,13 @@ impl<'a> Iterator for PathMatchCandidateSetIter<'a> {
|
||||
type Item = fuzzy::PathMatchCandidate<'a>;
|
||||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
self.traversal.next().map(|entry| match entry.kind {
|
||||
EntryKind::Dir => fuzzy::PathMatchCandidate {
|
||||
is_dir: true,
|
||||
self.traversal
|
||||
.next()
|
||||
.map(|entry| fuzzy::PathMatchCandidate {
|
||||
is_dir: entry.kind.is_dir(),
|
||||
path: &entry.path,
|
||||
char_bag: CharBag::from_iter(entry.path.to_string_lossy().to_lowercase().chars()),
|
||||
},
|
||||
EntryKind::File(char_bag) => fuzzy::PathMatchCandidate {
|
||||
is_dir: false,
|
||||
path: &entry.path,
|
||||
char_bag,
|
||||
},
|
||||
EntryKind::UnloadedDir | EntryKind::PendingDir => unreachable!(),
|
||||
})
|
||||
char_bag: entry.char_bag,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user