Don't pass &mut Workspace when closing items in a Pane

This allows closing items via actions even in the `TerminalPanel`
where the `Pane` is not directly owned by a `Workspace`.
This commit is contained in:
Antonio Scandurra 2023-05-09 11:45:39 +02:00
parent 506f978c41
commit 02066afb0e
4 changed files with 110 additions and 259 deletions

View file

@ -437,7 +437,7 @@ impl<T: Item> ItemHandle for ViewHandle<T> {
for item_event in T::to_item_events(event).into_iter() {
match item_event {
ItemEvent::CloseItem => {
Pane::close_item_by_id(workspace, pane, item.id(), cx)
pane.update(cx, |pane, cx| pane.close_item_by_id(item.id(), cx))
.detach_and_log_err(cx);
return;
}