Fix a bug where the terminal panel's items wouldn't be hooked up properly to workspace actions

This commit is contained in:
Mikayla Maki 2023-07-11 12:12:37 -07:00
parent 5012d618e6
commit be881369fa
No known key found for this signature in database
3 changed files with 12 additions and 2 deletions

View file

@ -221,6 +221,16 @@ impl TerminalPanel {
pane::Event::ZoomIn => cx.emit(Event::ZoomIn),
pane::Event::ZoomOut => cx.emit(Event::ZoomOut),
pane::Event::Focus => cx.emit(Event::Focus),
pane::Event::AddItem { item } => {
if let Some(workspace) = self.workspace.upgrade(cx) {
let pane = self.pane.clone();
workspace.update(cx, |workspace, cx| {
item.added_to_pane(workspace,pane, cx)
})
}
},
_ => {}
}
}

View file

@ -275,7 +275,7 @@ impl TerminalView {
cx.spawn(|this, mut cx| async move {
Timer::after(CURSOR_BLINK_INTERVAL).await;
this.update(&mut cx, |this, cx| this.resume_cursor_blinking(epoch, cx))
.log_err();
.ok();
})
.detach();
}

View file

@ -27,7 +27,7 @@ use std::{
};
use theme::Theme;
#[derive(Eq, PartialEq, Hash)]
#[derive(Eq, PartialEq, Hash, Debug)]
pub enum ItemEvent {
CloseItem,
UpdateTab,