From 4c07dc9553612112a3b25b298c2eeabf7a239409 Mon Sep 17 00:00:00 2001 From: Mikayla Maki Date: Wed, 14 Sep 2022 10:15:15 -0700 Subject: [PATCH] Added focus on dock toggle --- crates/workspace/src/dock.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/workspace/src/dock.rs b/crates/workspace/src/dock.rs index 2db2d49917..bdc3839441 100644 --- a/crates/workspace/src/dock.rs +++ b/crates/workspace/src/dock.rs @@ -152,7 +152,10 @@ impl Dock { let pane = workspace.dock.pane.clone(); if pane.read(cx).items().next().is_none() { let item_to_add = (workspace.dock.default_item_factory)(workspace, cx); + // Adding the item focuses the pane by default Pane::add_item(workspace, &pane, item_to_add, true, true, None, cx); + } else { + cx.focus(pane); } } else if let Some(last_active_center_pane) = workspace.last_active_center_pane.clone() { cx.focus(last_active_center_pane);