Compute view ancestry at layout time
This commit is contained in:
@@ -2,7 +2,6 @@ mod persistence;
|
||||
pub mod terminal_button;
|
||||
pub mod terminal_element;
|
||||
|
||||
use anyhow::anyhow;
|
||||
use context_menu::{ContextMenu, ContextMenuItem};
|
||||
use dirs::home_dir;
|
||||
use gpui::{
|
||||
@@ -628,16 +627,12 @@ impl Item for TerminalView {
|
||||
})
|
||||
});
|
||||
|
||||
let pane = pane
|
||||
.upgrade(&cx)
|
||||
.ok_or_else(|| anyhow!("pane was dropped"))?;
|
||||
cx.update(|cx| {
|
||||
let terminal = project.update(cx, |project, cx| {
|
||||
project.create_terminal(cwd, window_id, cx)
|
||||
})?;
|
||||
|
||||
Ok(cx.add_view(&pane, |cx| TerminalView::new(terminal, workspace_id, cx)))
|
||||
})
|
||||
let terminal = project.update(&mut cx, |project, cx| {
|
||||
project.create_terminal(cwd, window_id, cx)
|
||||
})?;
|
||||
Ok(pane.update(&mut cx, |_, cx| {
|
||||
cx.add_view(|cx| TerminalView::new(terminal, workspace_id, cx))
|
||||
})?)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user