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-16 01:41:51 +08:00 committed by GitHub
parent e3c6ba4bd7
commit 695176898e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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();