diff --git a/crates/workspace/src/pane_group.rs b/crates/workspace/src/pane_group.rs index 75db85f4a9bdb69c194b8781f427106c99a97a2b..8e129d5bca94cb55753e8cf07b6a08199062657b 100644 --- a/crates/workspace/src/pane_group.rs +++ b/crates/workspace/src/pane_group.rs @@ -522,6 +522,17 @@ pub enum SplitDirection { Right, } +impl std::fmt::Display for SplitDirection { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + SplitDirection::Up => write!(f, "up"), + SplitDirection::Down => write!(f, "down"), + SplitDirection::Left => write!(f, "left"), + SplitDirection::Right => write!(f, "right"), + } + } +} + impl SplitDirection { pub fn all() -> [Self; 4] { [Self::Up, Self::Down, Self::Left, Self::Right] diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rs index 19d203716b40e290941572d2f8ef161eb9ec73e4..ada481675365f19ce94ab639ba43963328200e47 100644 --- a/crates/workspace/src/workspace.rs +++ b/crates/workspace/src/workspace.rs @@ -2152,7 +2152,13 @@ impl Workspace { match target { Some(ActivateInDirectionTarget::Pane(pane)) => cx.focus_view(&pane), - Some(ActivateInDirectionTarget::Dock(dock)) => cx.focus_view(&dock), + 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()); + } + } None => {} } }