mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-30 22:34:13 +00:00
Reuse a previous project find whenever possible
Co-Authored-By: Max Brunsfeld <max@zed.dev>
This commit is contained in:
parent
e278c423d3
commit
368301fcec
1 changed files with 6 additions and 2 deletions
|
@ -330,8 +330,12 @@ impl ItemView for ProjectFindView {
|
|||
|
||||
impl ProjectFindView {
|
||||
fn deploy(workspace: &mut Workspace, _: &Deploy, cx: &mut ViewContext<Workspace>) {
|
||||
let model = cx.add_model(|cx| ProjectFind::new(workspace.project().clone(), cx));
|
||||
workspace.open_item(model, cx);
|
||||
if let Some(existing) = workspace.item_of_type::<ProjectFind>(cx) {
|
||||
workspace.activate_item(&existing, cx);
|
||||
} else {
|
||||
let model = cx.add_model(|cx| ProjectFind::new(workspace.project().clone(), cx));
|
||||
workspace.open_item(model, cx);
|
||||
}
|
||||
}
|
||||
|
||||
fn search(&mut self, _: &Search, cx: &mut ViewContext<Self>) {
|
||||
|
|
Loading…
Reference in a new issue