Do not activate inactive tabs when pinning or unpinning

Closes https://github.com/zed-industries/zed/issues/32024

Release Notes:

- Fixed a bug where inactive tabs would be activated when pinning or
unpinning.
This commit is contained in:
Joseph T. Lyons 2025-06-03 17:43:06 -04:00 committed by GitHub
parent 79b1dd7db8
commit 2db2271e3c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 212 additions and 35 deletions

View file

@ -3820,7 +3820,7 @@ impl Workspace {
};
let new_pane = self.add_pane(window, cx);
move_item(&from, &new_pane, item_id_to_move, 0, window, cx);
move_item(&from, &new_pane, item_id_to_move, 0, true, window, cx);
self.center
.split(&pane_to_split, &new_pane, split_direction)
.unwrap();
@ -7515,6 +7515,7 @@ pub fn move_item(
destination: &Entity<Pane>,
item_id_to_move: EntityId,
destination_index: usize,
activate: bool,
window: &mut Window,
cx: &mut App,
) {
@ -7538,8 +7539,18 @@ pub fn move_item(
// This automatically removes duplicate items in the pane
destination.update(cx, |destination, cx| {
destination.add_item(item_handle, true, true, Some(destination_index), window, cx);
window.focus(&destination.focus_handle(cx))
destination.add_item_inner(
item_handle,
activate,
activate,
activate,
Some(destination_index),
window,
cx,
);
if activate {
window.focus(&destination.focus_handle(cx))
}
});
}