diff --git a/crates/forktty-core/src/model.rs b/crates/forktty-core/src/model.rs index c86541a3..8b5761d9 100644 --- a/crates/forktty-core/src/model.rs +++ b/crates/forktty-core/src/model.rs @@ -906,7 +906,7 @@ impl WorkspaceModel { .workspaces .get_mut(&workspace_id) .expect("workspace verified above"); - if !push_tab_to_leaf(&mut workspace.pane_tree, near_surface_id, new_id.clone()) { + if !push_tab_to_leaf(&mut workspace.pane_tree, near_surface_id, &new_id) { return None; } workspace.focused_surface_id = new_id.clone(); diff --git a/crates/forktty-core/src/model/pane_tree.rs b/crates/forktty-core/src/model/pane_tree.rs index 2a3f7fc5..0c943e39 100644 --- a/crates/forktty-core/src/model/pane_tree.rs +++ b/crates/forktty-core/src/model/pane_tree.rs @@ -646,12 +646,12 @@ pub(super) fn set_leaf_active_for_surface(node: &mut PaneNode, surface_id: &str) pub(super) fn push_tab_to_leaf( node: &mut PaneNode, near_surface_id: &str, - new_tab_id: SurfaceId, + new_tab_id: &str, ) -> bool { match node { PaneNode::Leaf { tabs, active } => { if tabs.iter().any(|id| id == near_surface_id) { - tabs.push(new_tab_id); + tabs.push(new_tab_id.to_owned()); *active = tabs.len() - 1; true } else { @@ -660,6 +660,6 @@ pub(super) fn push_tab_to_leaf( } PaneNode::Split { children, .. } => children .iter_mut() - .any(|child| push_tab_to_leaf(child, near_surface_id, new_tab_id.clone())), + .any(|child| push_tab_to_leaf(child, near_surface_id, new_tab_id)), } }