mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-29 12:38:02 +00:00
Avoid moving tab when leader item updates
This commit is contained in:
parent
d70996bb99
commit
46f1d5f5c2
1 changed files with 6 additions and 1 deletions
|
@ -2676,7 +2676,12 @@ impl Workspace {
|
|||
}
|
||||
|
||||
for (pane, item) in items_to_add {
|
||||
Pane::add_item(self, &pane, item.boxed_clone(), false, false, None, cx);
|
||||
if let Some(index) = pane.update(cx, |pane, _| pane.index_for_item(item.as_ref())) {
|
||||
pane.update(cx, |pane, cx| pane.activate_item(index, false, false, cx));
|
||||
} else {
|
||||
Pane::add_item(self, &pane, item.boxed_clone(), false, false, None, cx);
|
||||
}
|
||||
|
||||
if pane == self.active_pane {
|
||||
pane.update(cx, |pane, cx| pane.focus_active_item(cx));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue