mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-16 15:11:25 +00:00
Give correct focus handle when project search has no matches
This commit is contained in:
parent
4be84f3db0
commit
de523c2d80
2 changed files with 5 additions and 2 deletions
|
@ -489,7 +489,6 @@ impl<'a> WindowContext<'a> {
|
||||||
|
|
||||||
#[cfg(any(test, feature = "test-support"))]
|
#[cfg(any(test, feature = "test-support"))]
|
||||||
{
|
{
|
||||||
println!("invalidating focus");
|
|
||||||
self.window.focus_invalidated = true;
|
self.window.focus_invalidated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -378,7 +378,11 @@ impl Render for ProjectSearchView {
|
||||||
|
|
||||||
impl FocusableView for ProjectSearchView {
|
impl FocusableView for ProjectSearchView {
|
||||||
fn focus_handle(&self, cx: &AppContext) -> gpui::FocusHandle {
|
fn focus_handle(&self, cx: &AppContext) -> gpui::FocusHandle {
|
||||||
self.results_editor.focus_handle(cx)
|
if self.has_matches() {
|
||||||
|
self.results_editor.focus_handle(cx)
|
||||||
|
} else {
|
||||||
|
self.query_editor.focus_handle(cx)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue