diff --git a/mux/src/lib.rs b/mux/src/lib.rs index 4c389d59d54..34a08c03d4e 100644 --- a/mux/src/lib.rs +++ b/mux/src/lib.rs @@ -1291,30 +1291,13 @@ impl Mux { tab.set_floating_pane_visibility(false); - let active_non_floating_pane = tab.iter_panes_ignoring_zoom() - .iter() - .nth(tab.get_active_idx()) - .map(|p| Arc::clone(&p.pane)) - .ok_or_else(|| anyhow::anyhow!("tab does not have a active non floating pane"))?; - - let pane_id = active_non_floating_pane.pane_id(); - - let pane_index = match tab - .iter_panes_ignoring_zoom() - .iter() - .find(|p| p.pane.pane_id() == pane_id) - { - Some(p) => p.index, - None => anyhow::bail!("invalid pane id {}", pane_id), - }; - let split_request = SplitRequest { direction, target_is_second: true, top_level: false, size: Default::default(), }; - tab.split_and_insert(pane_index, split_request, Arc::clone(&floating_pane))?; + tab.split_and_insert(tab.get_active_idx(), split_request, Arc::clone(&floating_pane))?; Ok(()) } diff --git a/mux/src/tab.rs b/mux/src/tab.rs index 046d9e2b0a0..ced014af66b 100644 --- a/mux/src/tab.rs +++ b/mux/src/tab.rs @@ -881,7 +881,6 @@ impl TabInner { self.active_floating_pane = root.active_floating_pane_index; self.floating_pane_visible = root.floating_pane_visible; - //TODO: we are in a lock this should be safe? is it needed? self.floating_panes.clear(); for pane_node in root.floating_panes { if let PaneNode::Leaf(entry) = pane_node {