From 37d3ed5f5f6358d44d0546e24d709b8d3e804787 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Tue, 9 May 2023 17:38:54 +0200 Subject: [PATCH] Focus new item if pane was focused when removing previous active item Previously, we were relying on the item getting blurred and the workspace receiving focus, which would in turn focus the active pane. This doesn't play well with docks because they aren't part of the workspace panes. --- crates/workspace/src/pane.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/workspace/src/pane.rs b/crates/workspace/src/pane.rs index 0523f082ea5a8d56014a5fe315b2263a66c966f7..30e782c7501ee19d80a92931c3300fa4b9dc529c 100644 --- a/crates/workspace/src/pane.rs +++ b/crates/workspace/src/pane.rs @@ -903,7 +903,8 @@ impl Pane { // to activating the item to the left .unwrap_or_else(|| item_index.min(self.items.len()).saturating_sub(1)); - self.activate_item(index_to_activate, activate_pane, activate_pane, cx); + let should_activate = activate_pane || self.has_focus; + self.activate_item(index_to_activate, should_activate, should_activate, cx); } let item = self.items.remove(item_index);