diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index 56734dd300..131b16e8b7 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -848,9 +848,10 @@ impl Editor { if let Some(item) = project::File::from_dyn(buffer.read(cx).file()) .and_then(|file| file.project_entry_id(cx)) - .and_then(|entry_id| workspace.item_for_entry(entry_id, cx)) + .and_then(|entry_id| workspace.active_pane().read(cx).item_for_entry(entry_id)) .and_then(|item| item.downcast()) { + workspace.activate_item(&item, cx); return item; } diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rs index e34cf1bff6..e10073c04a 100644 --- a/crates/workspace/src/workspace.rs +++ b/crates/workspace/src/workspace.rs @@ -646,16 +646,6 @@ impl Workspace { } } - pub fn item_for_entry( - &self, - entry_id: ProjectEntryId, - cx: &AppContext, - ) -> Option> { - self.panes() - .iter() - .find_map(|pane| pane.read(cx).item_for_entry(entry_id)) - } - pub fn item_of_type(&self, cx: &AppContext) -> Option> { self.items_of_type(cx).max_by_key(|item| item.id()) }