Merge pull request #517 from zed-industries/activate-pane-when-activating-item

Make pane active when activating one of its items
This commit is contained in:
Antonio Scandurra authored and GitHub committed 2022-03-02 17:33:12 +01:00
commit 4675ae8fa3
2 files changed
+9 -6

No files matched your search

+1
View File
@@ -326,6 +326,7 @@ impl Pane {
}
self.update_active_toolbar(cx);
self.focus_active_item(cx);
self.activate(cx);
cx.notify();
}
}
+8 -6
View File
@@ -1028,12 +1028,14 @@ impl Workspace {
}
fn activate_pane(&mut self, pane: ViewHandle<Pane>, cx: &mut ViewContext<Self>) {
self.active_pane = pane;
self.status_bar.update(cx, |status_bar, cx| {
status_bar.set_active_pane(&self.active_pane, cx);
});
cx.focus(&self.active_pane);
cx.notify();
if self.active_pane != pane {
self.active_pane = pane;
self.status_bar.update(cx, |status_bar, cx| {
status_bar.set_active_pane(&self.active_pane, cx);
});
cx.focus(&self.active_pane);
cx.notify();
}
}
fn handle_pane_event(