project_search: Fix message displayed when no results are found (#19108)

when no result found, always display `Search all files`, which is
confused.

Release Notes:

- Fixed an issue where the project search would sometimes show "Search
all files" when there were no results.

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
This commit is contained in:
CharlesChen0823
2024-10-15 13:41:51 -04:00
committed by GitHub
co-authored by Marshall Bowers
parent e3c6ba4bd7
commit 695176898e
+3 -1
View File
@@ -289,7 +289,6 @@ impl ProjectSearch {
.await;
this.update(&mut cx, |this, cx| {
this.no_results = Some(false);
this.match_ranges.extend(match_ranges);
cx.notify();
})
@@ -297,6 +296,9 @@ impl ProjectSearch {
}
this.update(&mut cx, |this, cx| {
if !this.match_ranges.is_empty() {
this.no_results = Some(false);
}
this.limit_reached = limit_reached;
this.pending_search.take();
cx.notify();