Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Improve file finder by ignoring spaces in query (#7068)

Ben Hamment5333eff0e480
diff --git a/crates/file_finder/src/file_finder.rs b/crates/file_finder/src/file_finder.rs
index f97c059a224..ca2808afb2a 100644
--- a/crates/file_finder/src/file_finder.rs
+++ b/crates/file_finder/src/file_finder.rs
@@ -666,6 +666,7 @@ impl PickerDelegate for FileFinderDelegate {
raw_query: String,
cx: &mut ViewContext<Picker<Self>>,
) -> Task<()> {
+ let raw_query = raw_query.replace(" ", "");
let raw_query = raw_query.trim();
if raw_query.is_empty() {
let project = self.project.read(cx);
diff --git a/crates/file_finder/src/file_finder_tests.rs b/crates/file_finder/src/file_finder_tests.rs
index ca07cbf0837..7702f71f460 100644
--- a/crates/file_finder/src/file_finder_tests.rs
+++ b/crates/file_finder/src/file_finder_tests.rs
@@ -53,6 +53,7 @@ async fn test_matching_paths(cx: &mut TestAppContext) {
" bandana ",
" ndan ",
" band ",
+ "a bandana",
] {
picker
.update(cx, |picker, cx| {