Implement "join pane into next" (#16077)

Closes #12409

Release Notes:

- Added "join pane into next" action ([#12409](https://github.com/zed-industries/zed/issues/12409))


https://github.com/zed-industries/zed/assets/727422/00cc8599-e5d6-4fb8-9f0d-9b232d2210ef

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
This commit is contained in:
Toni Cárdenas 2024-08-26 23:51:51 +02:00 committed by GitHub
parent f417893a7b
commit b99bf92452
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 238 additions and 26 deletions

View file

@ -173,16 +173,16 @@ impl TabSwitcherDelegate {
};
cx.subscribe(&pane, |tab_switcher, _, event, cx| {
match event {
PaneEvent::AddItem { .. } | PaneEvent::RemovedItem { .. } | PaneEvent::Remove => {
tab_switcher.picker.update(cx, |picker, cx| {
let selected_item_id = picker.delegate.selected_item_id();
picker.delegate.update_matches(cx);
if let Some(item_id) = selected_item_id {
picker.delegate.select_item(item_id, cx);
}
cx.notify();
})
}
PaneEvent::AddItem { .. }
| PaneEvent::RemovedItem { .. }
| PaneEvent::Remove { .. } => tab_switcher.picker.update(cx, |picker, cx| {
let selected_item_id = picker.delegate.selected_item_id();
picker.delegate.update_matches(cx);
if let Some(item_id) = selected_item_id {
picker.delegate.select_item(item_id, cx);
}
cx.notify();
}),
_ => {}
};
})