diff options
author | Aram Drevekenin <aram@poor.dev> | 2023-03-30 16:53:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-30 16:53:46 +0200 |
commit | d121c780bf3292f7bb2a257b3b23b32ef6c2c6d4 (patch) | |
tree | 924cda34e96eef820070496154950003abda67fd /zellij-utils | |
parent | 220f6684b0e6ae2dbcacc7d65bd89c59aca81ca9 (diff) |
fix(layouts): do not default to default swap layouts when opening a new tab without swap layouts (#2336)
Diffstat (limited to 'zellij-utils')
-rw-r--r-- | zellij-utils/src/input/actions.rs | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/zellij-utils/src/input/actions.rs b/zellij-utils/src/input/actions.rs index d75897918..d03fd1202 100644 --- a/zellij-utils/src/input/actions.rs +++ b/zellij-utils/src/input/actions.rs @@ -440,16 +440,8 @@ impl Action { if tabs.len() > 1 { return Err(format!("Tab layout cannot itself have tabs")); } else if !tabs.is_empty() { - let swap_tiled_layouts = if layout.swap_tiled_layouts.is_empty() { - None - } else { - Some(layout.swap_tiled_layouts.clone()) - }; - let swap_floating_layouts = if layout.swap_floating_layouts.is_empty() { - None - } else { - Some(layout.swap_floating_layouts.clone()) - }; + let swap_tiled_layouts = Some(layout.swap_tiled_layouts.clone()); + let swap_floating_layouts = Some(layout.swap_floating_layouts.clone()); let (tab_name, layout, floating_panes_layout) = tabs.drain(..).next().unwrap(); let name = tab_name.or(name); @@ -461,16 +453,8 @@ impl Action { name, )]) } else { - let swap_tiled_layouts = if layout.swap_tiled_layouts.is_empty() { - None - } else { - Some(layout.swap_tiled_layouts.clone()) - }; - let swap_floating_layouts = if layout.swap_floating_layouts.is_empty() { - None - } else { - Some(layout.swap_floating_layouts.clone()) - }; + let swap_tiled_layouts = Some(layout.swap_tiled_layouts.clone()); + let swap_floating_layouts = Some(layout.swap_floating_layouts.clone()); let (layout, floating_panes_layout) = layout.new_tab(); Ok(vec![Action::NewTab( Some(layout), |