Don't focus active editor when deploying project search and focus query editor on project search focus
This commit is contained in:
@@ -177,11 +177,7 @@ impl View for ProjectSearchView {
|
|||||||
.insert(self.model.read(cx).project.downgrade(), handle)
|
.insert(self.model.read(cx).project.downgrade(), handle)
|
||||||
});
|
});
|
||||||
|
|
||||||
if self.model.read(cx).match_ranges.is_empty() {
|
self.focus_query_editor(cx);
|
||||||
cx.focus(&self.query_editor);
|
|
||||||
} else {
|
|
||||||
self.focus_results_editor(cx);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -390,6 +386,7 @@ impl ProjectSearchView {
|
|||||||
|
|
||||||
if let Some(existing) = existing {
|
if let Some(existing) = existing {
|
||||||
workspace.activate_item(&existing, cx);
|
workspace.activate_item(&existing, cx);
|
||||||
|
existing.update(cx, |existing, cx| existing.focus_query_editor(cx));
|
||||||
} else {
|
} else {
|
||||||
let model = cx.add_model(|cx| ProjectSearch::new(workspace.project().clone(), cx));
|
let model = cx.add_model(|cx| ProjectSearch::new(workspace.project().clone(), cx));
|
||||||
workspace.add_item(
|
workspace.add_item(
|
||||||
|
|||||||
Reference in New Issue
Block a user