Merge pull request #1924 from zed-industries/simon-says-dont-move

Do not reorder tab opened by follower to end of item list
This commit is contained in:
Julia 2022-12-04 13:00:07 -05:00 committed by GitHub
commit 11c1254e71
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 129 additions and 1 deletions

View file

@ -2147,7 +2147,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));
}