Fix panic in activate_pane_in_direction (#21948)

Ah, invalid SecondaryMap key, we meet again...

Release Notes:

- Fixed panic when jumping between panes
This commit is contained in:
Cole Miller 2024-12-17 22:10:30 -05:00 committed by GitHub
parent 5d7b6141fd
commit 672fc76832
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2960,11 +2960,13 @@ impl Workspace {
match target {
Some(ActivateInDirectionTarget::Pane(pane)) => cx.focus_view(&pane),
Some(ActivateInDirectionTarget::Dock(dock)) => {
if let Some(panel) = dock.read(cx).active_panel() {
panel.focus_handle(cx).focus(cx);
} else {
log::error!("Could not find a focus target when in switching focus in {direction} direction for a {:?} dock", dock.read(cx).position());
}
dock.update(cx, |dock, cx| {
if let Some(panel) = dock.active_panel() {
panel.focus_handle(cx).focus(cx);
} else {
log::error!("Could not find a focus target when in switching focus in {direction} direction for a {:?} dock", dock.position());
}
});
}
None => {}
}