diff options
| author | Aram Drevekenin <aram@poor.dev> | 2023-02-17 12:05:50 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-17 12:05:50 +0100 |
| commit | f1ff272b0b65f6d328fef24531ada67ea585ce85 (patch) | |
| tree | 0e33aa4a1af21c0785fa30118ee42a21972497cf /zellij-utils/src/input | |
| parent | docs(changelog): termwiz update (diff) | |
| download | sl0ppij-f1ff272b0b65f6d328fef24531ada67ea585ce85.tar.gz sl0ppij-f1ff272b0b65f6d328fef24531ada67ea585ce85.tar.xz sl0ppij-f1ff272b0b65f6d328fef24531ada67ea585ce85.zip | |
feat(ui): swap layouts and stacked panes (#2167)
* relayout working with hard coded layout
* work
* refactor(layout): PaneLayout => TiledPaneLayout
* tests passing
* tests passing
* tests passing
* stacked panes and passing tests
* tests for stacked panes
* refactor(panes): stacked panes
* fix: focusing into stacked panes from the left/right
* fix(layouts): handle stacked layouts in the middle of the screen
* fix(pane-stack): focus correctly when coming to stack from above/below
* fix(stacked-panes): resize stack
* fix(stacked-panes): focus with mouse
* fix(stacked-panes): focus next pane
* fix(layout-applier): sane focus order
* fix(stacked-panes): better titles for one-liners
* fix(stacked-panes): handle moving pane location in stack
* fix(relayout): properly calculate display area
* fix(relayout): properly calculate rounding errors
* fix(stacked-panes): properly handle closing a pane near a stack
* fix(swap-layouts): adjust swap layout sort order
* feat(swap-layouts): ui + ux
* fix(swap-layouts): include base layout
* refactor(layout): remove unused method
* fix(swap-layouts): respect pane contents and focus
* work
* fix(swap-layouts): load swap layouts from external file
* fix(swap-layouts): properly truncate layout children
* fix(stacked-panes): allow stacked panes to become fullscreen
* fix(swap-layouts): work with multiple tabs
* fix(swap-layouts): embed/eject panes properly with auto-layout
* fix(stacked-panes): close last pane in stack
* fix(stacked-panes): move focus for all clients in stack
* fix(floating-panes): set layout damaged when moving panes
* fix(relayout): move out of unfitting layout when resizing whole tab
* fix(ui): background color for swap layout indicator
* fix(keybinds): add switch next layout in tmux
* fix(ui): swap layout indication in compact layout
* fix(compact): correct swap constraint
* fix(tests): tmux swap config shortcut
* fix(resizes): cache resizes so as not to confuse panes (eg. vim) with multiple resizes that it debounces weirdly
* feat(cli): dump swap layouts
* fix(ui): stacked panes without pane frames
* fix(ux): move pane forward/backwards also with floating panes
* refactor(lint): remove unused stuff
* refactor(tab): move swap layouts to separate file
* style(fmt): rustfmt
* style(fmt): rustfmt
* refactor(panes): various cleanups
* chore(deps): upgrade termwiz to get alt left-bracket
* fix(assets): merge conflicts of binary files
* style(fmt): rustfmt
* style(clippy): no thank you!
* chore(repo): remove garbage file
Diffstat (limited to 'zellij-utils/src/input')
42 files changed, 3382 insertions, 2032 deletions
diff --git a/zellij-utils/src/input/actions.rs b/zellij-utils/src/input/actions.rs index 7db0e4f3..a4f4b74f 100644 --- a/zellij-utils/src/input/actions.rs +++ b/zellij-utils/src/input/actions.rs @@ -1,7 +1,9 @@ //! Definition of the actions that can be bound to keys. use super::command::RunCommandAction; -use super::layout::{FloatingPanesLayout, Layout, PaneLayout}; +use super::layout::{ + FloatingPaneLayout, Layout, SwapFloatingLayout, SwapTiledLayout, TiledPaneLayout, +}; use crate::cli::CliAction; use crate::data::InputMode; use crate::data::{Direction, Resize}; @@ -115,6 +117,7 @@ pub enum Action { /// If there is no pane in the direction, move to previous/next Tab. MoveFocusOrTab(Direction), MovePane(Option<Direction>), + MovePaneBackwards, /// Dumps the screen to a file DumpScreen(String, bool), /// Scroll up in focus pane. @@ -164,7 +167,13 @@ pub enum Action { PaneNameInput(Vec<u8>), UndoRenamePane, /// Create a new tab, optionally with a specified tab layout. - NewTab(Option<PaneLayout>, Vec<FloatingPanesLayout>, Option<String>), // the String is the tab name + NewTab( + Option<TiledPaneLayout>, + Vec<FloatingPaneLayout>, + Option<Vec<SwapTiledLayout>>, + Option<Vec<SwapFloatingLayout>>, + Option<String>, + ), // the String is the tab name /// Do nothing. NoOp, /// Go to the next tab. @@ -205,13 +214,15 @@ pub enum Action { /// Toggle case sensitivity of search SearchToggleOption(SearchOption), ToggleMouseMode, + PreviousSwapLayout, + NextSwapLayout, } impl Action { /// Checks that two Action are match except their mutable attributes. pub fn shallow_eq(&self, other_action: &Action) -> bool { match (self, other_action) { - (Action::NewTab(_, _, _), Action::NewTab(_, _, _)) => true, + (Action::NewTab(..), Action::NewTab(..)) => true, _ => self == other_action, } } @@ -228,7 +239,8 @@ impl Action { CliAction::FocusPreviousPane => Ok(vec![Action::FocusPreviousPane]), CliAction::MoveFocus { direction } => Ok(vec![Action::MoveFocus(direction)]), CliAction::MoveFocusOrTab { direction } => Ok(vec![Action::MoveFocusOrTab(direction)]), - CliAction::MovePane { direction } => Ok(vec![Action::MovePane(Some(direction))]), + CliAction::MovePane { direction } => Ok(vec![Action::MovePane(direction)]), + CliAction::MovePaneBackwards => Ok(vec![Action::MovePaneBackwards]), CliAction::DumpScreen { path, full } => Ok(vec![Action::DumpScreen( path.as_os_str().to_string_lossy().into(), full, @@ -342,10 +354,10 @@ impl Action { .map(|cwd| current_dir.join(cwd)) .or_else(|| Some(current_dir)); if let Some(layout_path) = layout { - let (path_to_raw_layout, raw_layout) = + let (path_to_raw_layout, raw_layout, swap_layouts) = Layout::stringified_from_path_or_default(Some(&layout_path), None) .map_err(|e| format!("Failed to load layout: {}", e))?; - let layout = Layout::from_str(&raw_layout, path_to_raw_layout, cwd).map_err(|e| { + let layout = Layout::from_str(&raw_layout, path_to_raw_layout, swap_layouts.as_ref().map(|(f, p)| (f.as_str(), p.as_str())), cwd).map_err(|e| { let stringified_error = match e { ConfigError::KdlError(kdl_error) => { let error = kdl_error.add_src(layout_path.as_path().as_os_str().to_string_lossy().to_string(), String::from(raw_layout)); @@ -381,26 +393,52 @@ 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 (tab_name, layout, floating_panes_layout) = tabs.drain(..).next().unwrap(); let name = tab_name.or(name); Ok(vec![Action::NewTab( Some(layout), floating_panes_layout, + swap_tiled_layouts, + swap_floating_layouts, 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 (layout, floating_panes_layout) = layout.new_tab(); Ok(vec![Action::NewTab( Some(layout), floating_panes_layout, + swap_tiled_layouts, + swap_floating_layouts, name, )]) } } else { - Ok(vec![Action::NewTab(None, vec![], name)]) + Ok(vec![Action::NewTab(None, vec![], None, None, name)]) } }, + CliAction::PreviousSwapLayout => Ok(vec![Action::PreviousSwapLayout]), + CliAction::NextSwapLayout => Ok(vec![Action::NextSwapLayout]), } } } diff --git a/zellij-utils/src/input/layout.rs b/zellij-utils/src/input/layout.rs index eaa2e395..a0d61b24 100644 --- a/zellij-utils/src/input/layout.rs +++ b/zellij-utils/src/input/layout.rs @@ -22,6 +22,7 @@ use std::str::FromStr; use super::plugins::{PluginTag, PluginsConfigError}; use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; use std::convert::TryFrom; use std::vec::Vec; use std::{ @@ -169,6 +170,21 @@ impl Run { } } } + pub fn is_same_category(first: &Option<Run>, second: &Option<Run>) -> bool { + match (first, second) { + (Some(Run::Plugin(..)), Some(Run::Plugin(..))) => true, + (Some(Run::Command(..)), Some(Run::Command(..))) => true, + (Some(Run::EditFile(..)), Some(Run::EditFile(..))) => true, + (Some(Run::Cwd(..)), Some(Run::Cwd(..))) => true, + _ => false, + } + } + pub fn is_terminal(run: &Option<Run>) -> bool { + match run { + Some(Run::Command(..)) | Some(Run::EditFile(..)) | Some(Run::Cwd(..)) | None => true, + _ => false, + } + } } #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)] @@ -211,12 +227,27 @@ impl fmt::Display for RunPluginLocation { } } +#[derive(Clone, Debug, PartialEq, Eq, Hash, Ord, PartialOrd, Serialize, Deserialize)] +pub enum LayoutConstraint { + MaxPanes(usize), + MinPanes(usize), + NoConstraint, +} + +pub type SwapTiledLayout = (BTreeMap<LayoutConstraint, TiledPaneLayout>, Option<String>); // Option<String> is the swap layout name +pub type SwapFloatingLayout = ( + BTreeMap<LayoutConstraint, Vec<FloatingPaneLayout>>, + Option<String>, +); // Option<String> is the swap layout name + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq, Default)] pub struct Layout { - pub tabs: Vec<(Option<String>, PaneLayout, Vec<FloatingPanesLayout>)>, + pub tabs: Vec<(Option<String>, TiledPaneLayout, Vec<FloatingPaneLayout>)>, pub focused_tab_index: Option<usize>, - pub template: Option<PaneLayout>, - pub floating_panes_template: Vec<FloatingPanesLayout>, + pub template: Option<(TiledPaneLayout, Vec<FloatingPaneLayout>)>, + pub swap_layouts: Vec<(TiledPaneLayout, Vec<FloatingPaneLayout>)>, + pub swap_tiled_layouts: Vec<SwapTiledLayout>, + pub swap_floating_layouts: Vec<SwapFloatingLayout>, } #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)] @@ -270,8 +301,7 @@ impl FromStr for PercentOrFixed { } #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq, Default)] -pub struct FloatingPanesLayout { - // TODO: change name to singular +pub struct FloatingPaneLayout { pub name: Option<String>, pub height: Option<PercentOrFixed>, pub width: Option<PercentOrFixed>, @@ -281,7 +311,7 @@ pub struct FloatingPanesLayout { pub focus: Option<bool>, } -impl FloatingPanesLayout { +impl FloatingPaneLayout { pub fn add_cwd_to_layout(&mut self, cwd: &PathBuf) { match self.run.as_mut() { Some(run) => run.add_cwd(cwd), @@ -292,9 +322,9 @@ impl FloatingPanesLayout { } } -impl From<&PaneLayout> for FloatingPanesLayout { - fn from(pane_layout: &PaneLayout) -> Self { - FloatingPanesLayout { +impl From<&TiledPaneLayout> for FloatingPaneLayout { + fn from(pane_layout: &TiledPaneLayout) -> Self { + FloatingPaneLayout { name: pane_layout.name.clone(), run: pane_layout.run.clone(), focus: pane_layout.focus, @@ -304,21 +334,22 @@ impl From<&PaneLayout> for FloatingPanesLayout { } #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq, Default)] -pub struct PaneLayout { +pub struct TiledPaneLayout { pub children_split_direction: SplitDirection, pub name: Option<String>, - pub children: Vec<PaneLayout>, + pub children: Vec<TiledPaneLayout>, pub split_size: Option<SplitSize>, pub run: Option<Run>, pub borderless: bool, pub focus: Option<bool>, pub external_children_index: Option<usize>, + pub children_are_stacked: bool, } -impl PaneLayout { +impl TiledPaneLayout { pub fn insert_children_layout( &mut self, - children_layout: &mut PaneLayout, + children_layout: &mut TiledPaneLayout, ) -> Result<bool, ConfigError> { // returns true if successfully inserted and false otherwise match self.external_children_index { @@ -338,6 +369,30 @@ impl PaneLayout { }, } } + pub fn insert_children_nodes( + &mut self, + children_nodes: &mut Vec<TiledPaneLayout>, + ) -> Result<bool, ConfigError> { + // returns true if successfully inserted and false otherwise + match self.external_children_index { + Some(external_children_index) => { + children_nodes.reverse(); + for child_node in children_nodes.drain(..) { + self.children.insert(external_children_index, child_node); + } + self.external_children_index = None; + Ok(true) + }, + None => { + for pane in self.children.iter_mut() { + if pane.insert_children_nodes(children_nodes)? { + return Ok(true); + } + } + Ok(false) + }, + } + } pub fn children_block_count(&self) -> usize { let mut count = 0; if self.external_children_index.is_some() { @@ -348,11 +403,50 @@ impl PaneLayout { } count } + pub fn pane_count(&self) -> usize { + if self.children.is_empty() { + 1 // self + } else { + let mut pane_count = 0; + for child in &self.children { + pane_count += child.pane_count(); + } + pane_count + } + } pub fn position_panes_in_space( &self, space: &PaneGeom, - ) -> Result<Vec<(PaneLayout, PaneGeom)>, &'static str> { - let layouts = split_space(space, self, space); + max_panes: Option<usize>, + ) -> Result<Vec<(TiledPaneLayout, PaneGeom)>, &'static str> { + let layouts = match max_panes { + Some(max_panes) => { + let mut layout_to_split = self.clone(); + let pane_count_in_layout = layout_to_split.pane_count(); + if max_panes > pane_count_in_layout { + // the + 1 here is because this was previously an "actual" pane and will now + // become just a container, so we need to account for it too + // TODO: make sure this works when the `children` node has sibling nodes, + // because we really should support that + let children_count = (max_panes - pane_count_in_layout) + 1; + let mut extra_children = vec![TiledPaneLayout::default(); children_count]; + if !layout_to_split.has_focused_node() { + if let Some(last_child) = extra_children.last_mut() { + last_child.focus = Some(true); + } + } + let _ = layout_to_split.insert_children_nodes(&mut extra_children); + } else { + layout_to_split.truncate(max_panes); + } + if !layout_to_split.has_focused_node() { + layout_to_split.focus_deepest_pane(); + } + + split_space(space, &layout_to_split, space)? + }, + None => split_space(space, self, space)?, + }; for (_pane_layout, pane_geom) in layouts.iter() { if !pane_geom.is_at_least_minimum_size() { return Err("No room on screen for this layout!"); @@ -374,8 +468,8 @@ impl PaneLayout { run_instructions } pub fn with_one_pane() -> Self { - let mut default_layout = PaneLayout::default(); - default_layout.children = vec![PaneLayout::default()]; + let mut default_layout = TiledPaneLayout::default(); + default_layout.children = vec![TiledPaneLayout::default()]; default_layout } pub fn add_cwd_to_layout(&mut self, cwd: &PathBuf) { @@ -389,6 +483,79 @@ impl PaneLayout { child.add_cwd_to_layout(cwd); } } + pub fn deepest_depth(&self) -> usize { + let mut deepest_child_depth = 0; + for child in self.children.iter() { + let child_deepest_depth = child.deepest_depth(); + if child_deepest_depth > deepest_child_depth { + deepest_child_depth = child_deepest_depth; + } + } + deepest_child_depth + 1 + } + pub fn focus_deepest_pane(&mut self) { + let mut deepest_child_index = None; + let mut deepest_path = 0; + for (i, child) in self.children.iter().enumerate() { + let child_deepest_path = child.deepest_depth(); + if child_deepest_path >= deepest_path { + deepest_path = child_deepest_path; + deepest_child_index = Some(i) + } + } + match deepest_child_index { + Some(deepest_child_index) => { + if let Some(child) = self.children.get_mut(deepest_child_index) { + child.focus_deepest_pane(); + } + }, + None => { + self.focus = Some(true); + }, + } + } + pub fn truncate(&mut self, max_panes: usize) -> usize { + // returns remaining children length + // if max_panes is 1, it means there's only enough panes for this node, + // if max_panes is 0, this is probably the root layout being called with 0 max panes + if max_panes <= 1 { + self.children.clear(); + } else if max_panes <= self.children.len() { + self.children.truncate(max_panes); + self.children.iter_mut().for_each(|l| l.children.clear()); + } else { + let mut remaining_panes = max_panes + - self + .children + .iter() + .filter(|c| c.children.is_empty()) + .count(); + for child in self.children.iter_mut() { + if remaining_panes > 1 && child.children.len() > 0 { + remaining_panes = + remaining_panes.saturating_sub(child.truncate(remaining_panes)); + } else { + child.children.clear(); + } + } + } + if self.children.len() > 0 { + self.children.len() + } else { + 1 // just me + } + } + pub fn has_focused_node(&self) -> bool { + if self.focus.map(|f| f).unwrap_or(false) { + return true; + }; + for child in &self.children { + if child.has_focused_node() { + return true; + } + } + false + } } #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)] @@ -429,8 +596,8 @@ impl Layout { pub fn stringified_from_path_or_default( layout_path: Option<&PathBuf>, layout_dir: Option<PathBuf>, - ) -> Result<(String, String), ConfigError> { - // (path_to_layout as String, stringified_layout) + ) -> Result<(String, String, Option<(String, String)>), ConfigError> { + // (path_to_layout as String, stringified_layout, Option<path_to_swap_layout as String, stringified_swap_layout>) match layout_path { Some(layout_path) => { // The way we determine where to look for the layout is similar to @@ -455,24 +622,32 @@ impl Layout { layout_dir: Option<PathBuf>, config: Config, ) -> Result<(Layout, Config), ConfigError> { - let (path_to_raw_layout, raw_layout) = + let (path_to_raw_layout, raw_layout, raw_swap_layouts) = Layout::stringified_from_path_or_default(layout_path, layout_dir)?; - let layout = Layout::from_kdl(&raw_layout, path_to_raw_layout, None)?; + let layout = Layout::from_kdl( + &raw_layout, + path_to_raw_layout, + raw_swap_layouts + .as_ref() + .map(|(r, f)| (r.as_str(), f.as_str())), + None, + )?; let config = Config::from_kdl(&raw_layout, Some(config))?; // this merges the two config, with Ok((layout, config)) } pub fn from_str( raw: &str, path_to_raw_layout: String, + swap_layouts: Option<(&str, &str)>, // Option<path_to_swap_layout, stringified_swap_layout> cwd: Option<PathBuf>, ) -> Result<Layout, ConfigError> { - Layout::from_kdl(raw, path_to_raw_layout, cwd) + Layout::from_kdl(raw, path_to_raw_layout, swap_layouts, cwd) } pub fn stringified_from_dir( layout: &PathBuf, layout_dir: Option<&PathBuf>, - ) -> Result<(String, String), ConfigError> { - // (path_to_layout as String, stringified_layout) + ) -> Result<(String, String, Option<(String, String)>), ConfigError> { + // (path_to_layout as String, stringified_layout, Option<path_to_swap_layout as String, stringified_swap_layout>) match layout_dir { Some(dir) => { let layout_path = &dir.join(layout); @@ -485,18 +660,28 @@ impl Layout { None => Layout::stringified_from_default_assets(layout), } } - pub fn stringified_from_path(layout_path: &Path) -> Result<(String, String), ConfigError> { - // (path_to_layout as String, stringified_layout) + pub fn stringified_from_path( + layout_path: &Path, + ) -> Result<(String, String, Option<(String, String)>), ConfigError> { + // (path_to_layout as String, stringified_layout, Option<path_to_swap_layout as String, stringified_swap_layout>) let mut layout_file = File::open(&layout_path) .or_else(|_| File::open(&layout_path.with_extension("kdl"))) .map_err(|e| ConfigError::IoPath(e, layout_path.into()))?; + let swap_layout_and_path = Layout::swap_layout_and_path(&layout_path); + let mut kdl_layout = String::new(); layout_file.read_to_string(&mut kdl_layout)?; - Ok((layout_path.as_os_str().to_string_lossy().into(), kdl_layout)) + Ok(( + layout_path.as_os_str().to_string_lossy().into(), + kdl_layout, + swap_layout_and_path, + )) } - pub fn stringified_from_default_assets(path: &Path) -> Result<(String, String), ConfigError> { - // (path_to_layout as String, stringified_layout) + pub fn stringified_from_default_assets( + path: &Path, + ) -> Result<(String, String, Option<(String, String)>), ConfigError> { + // (path_to_layout as String, stringified_layout, Option<path_to_swap_layout as String, stringified_swap_layout>) // TODO: ideally these should not be hard-coded // we should load layouts by name from the config // and load them from a hashmap or some such @@ -504,18 +689,31 @@ impl Layout { Some("default") => Ok(( "Default layout".into(), Self::stringified_default_from_assets()?, + Some(( + "Default swap layout".into(), + Self::stringified_default_swap_from_assets()?, + )), )), Some("strider") => Ok(( "Strider layout".into(), Self::stringified_strider_from_assets()?, + Some(( + "Strider swap layout".into(), + Self::stringified_strider_swap_from_assets()?, + )), )), Some("disable-status-bar") => Ok(( "Disable Status Bar layout".into(), Self::stringified_disable_status_from_assets()?, + None, )), Some("compact") => Ok(( "Compact layout".into(), Self::stringified_compact_from_assets()?, + Some(( + "Compact layout swap".into(), + Self::stringified_compact_swap_from_assets()?, + )), )), None | Some(_) => Err(ConfigError::IoPath( std::io::Error::new(std::io::ErrorKind::Other, "The layout was not found"), @@ -526,10 +724,15 @@ impl Layout { pub fn stringified_default_from_assets() -> Result<String, ConfigError> { Ok(String::from_utf8(setup::DEFAULT_LAYOUT.to_vec())?) } - + pub fn stringified_default_swap_from_assets() -> Result<String, ConfigError> { + Ok(String::from_utf8(setup::DEFAULT_SWAP_LAYOUT.to_vec())?) + } pub fn stringified_strider_from_assets() -> Result<String, ConfigError> { Ok(String::from_utf8(setup::STRIDER_LAYOUT.to_vec())?) } + pub fn stringified_strider_swap_from_assets() -> Result<String, ConfigError> { + Ok(String::from_utf8(setup::STRIDER_SWAP_LAYOUT.to_vec())?) + } pub fn stringified_disable_status_from_assets() -> Result<String, ConfigError> { Ok(String::from_utf8(setup::NO_STATUS_LAYOUT.to_vec())?) @@ -539,12 +742,12 @@ impl Layout { Ok(String::from_utf8(setup::COMPACT_BAR_LAYOUT.to_vec())?) } - pub fn new_tab(&self) -> (PaneLayout, Vec<FloatingPanesLayout>) { - let template = match &self.template { - Some(template) => template.clone(), - None => PaneLayout::default(), - }; - (template, self.floating_panes_template.clone()) + pub fn stringified_compact_swap_from_assets() -> Result<String, ConfigError> { + Ok(String::from_utf8(setup::COMPACT_BAR_SWAP_LAYOUT.to_vec())?) + } + + pub fn new_tab(&self) -> (TiledPaneLayout, Vec<FloatingPaneLayout>) { + self.template.clone().unwrap_or_default() } pub fn is_empty(&self) -> bool { @@ -555,7 +758,7 @@ impl Layout { !self.tabs.is_empty() } - pub fn tabs(&self) -> Vec<(Option<String>, PaneLayout, Vec<FloatingPanesLayout>)> { + pub fn tabs(&self) -> Vec<(Option<String>, TiledPaneLayout, Vec<FloatingPaneLayout>)> { // String is the tab name self.tabs.clone() } @@ -563,16 +766,60 @@ impl Layout { pub fn focused_tab_index(&self) -> Option<usize> { self.focused_tab_index } + + fn swap_layout_and_path(path: &Path) -> Option<(String, String)> { + // Option<path, stringified_swap_layout> + let mut swap_layout_path = PathBuf::from(path); + swap_layout_path.set_extension("swap.kdl"); + match File::open(&swap_layout_path) { + Ok(mut stringified_swap_layout_file) => { + let mut swap_kdl_layout = String::new(); + match stringified_swap_layout_file.read_to_string(&mut swap_kdl_layout) { + Ok(..) => Some(( + swap_layout_path.as_os_str().to_string_lossy().into(), + swap_kdl_layout, + )), + Err(e) => { + log::warn!( + "Failed to read swap layout file: {}. Error: {:?}", + swap_layout_path.as_os_str().to_string_lossy(), + e + ); + None + }, + } + }, + Err(e) => { + log::warn!( + "Failed to read swap layout file: {}. Error: {:?}", + swap_layout_path.as_os_str().to_string_lossy(), + e + ); + None + }, + } + } } fn split_space( space_to_split: &PaneGeom, - layout: &PaneLayout, + layout: &TiledPaneLayout, total_space_to_split: &PaneGeom, -) -> Vec<(PaneLayout, PaneGeom)> { +) -> Result<Vec<(TiledPaneLayout, PaneGeom)>, &'static str> { let mut pane_positions = Vec::new(); - let sizes: Vec<Option<SplitSize>> = - layout.children.iter().map(|part| part.split_size).collect(); + let sizes: Vec<Option<SplitSize>> = if layout.children_are_stacked { + let mut sizes: Vec<Option<SplitSize>> = layout + .children + .iter() + .map(|_part| Some(SplitSize::Fixed(1))) + .collect(); + if let Some(last_size) = sizes.last_mut() { + *last_size = None; + } + sizes + } else { + layout.children.iter().map(|part| part.split_size).collect() + }; let mut split_geom = Vec::new(); let ( @@ -595,7 +842,22 @@ fn split_space( ), }; + let min_size_for_panes = sizes.iter().fold(0, |acc, size| match size { + Some(SplitSize::Percent(_)) | None => acc + 1, // TODO: minimum height/width as relevant here + Some(SplitSize::Fixed(fixed)) => acc + fixed, + }); + if min_size_for_panes > split_dimension_space.as_usize() { + return Err("Not enough room for panes"); // TODO: use error infra + } + let flex_parts = sizes.iter().filter(|s| s.is_none()).count(); + let total_fixed_size = sizes.iter().fold(0, |acc, s| { + if let Some(SplitSize::Fixed(fixed)) = s { + acc + fixed + } else { + acc + } + }); let mut total_pane_size = 0; for (&size, _part) in sizes.iter().zip(&*layout.children) { @@ -617,7 +879,11 @@ fn split_space( Dimension::percent(free_percent / flex_parts as f64) }, }; - split_dimension.adjust_inner(total_split_dimension_space.as_usize()); + split_dimension.adjust_inner( + total_split_dimension_space + .as_usize() + .saturating_sub(total_fixed_size), + ); total_pane_size += split_dimension.as_usize(); let geom = match layout.children_split_direction { @@ -626,20 +892,22 @@ fn split_space( y: space_to_split.y, cols: split_dimension, rows: inherited_dimension, + is_stacked: layout.children_are_stacked, }, SplitDirection::Horizontal => PaneGeom { x: space_to_split.x, y: current_position, cols: inherited_dimension, rows: split_dimension, + is_stacked: layout.children_are_stacked, }, }; split_geom.push(geom); current_position += split_dimension.as_usize(); } - // add extra space from rounding errors to the last pane if total_pane_size < split_dimension_space.as_usize() { + // add extra space from rounding errors to the last pane let increase_by = split_dimension_space.as_usize() - total_pane_size; if let Some(last_geom) = split_geom.last_mut() { match layout.children_split_direction { @@ -647,21 +915,32 @@ fn split_space( SplitDirection::Horizontal => last_geom.rows.increase_inner(increase_by), } } + } else if total_pane_size > split_dimension_space.as_usize() { + // remove extra space from rounding errors to the last pane + let decrease_by = total_pane_size - split_dimension_space.as_usize(); + if let Some(last_geom) = split_geom.last_mut() { + match layout.children_split_direction { + SplitDirection::Vertical => last_geom.cols.decrease_inner(decrease_by), + SplitDirection::Horizontal => last_geom.rows.decrease_inner(decrease_by), + } + } } for (i, part) in layout.children.iter().enumerate() { let part_position_and_size = split_geom.get(i).unwrap(); if !part.children.is_empty() { let mut part_positions = - split_space(part_position_and_size, part, total_space_to_split); + split_space(part_position_and_size, part, total_space_to_split)?; pane_positions.append(&mut part_positions); } else { - pane_positions.push((part.clone(), *part_position_and_size)); + let part = part.clone(); + pane_positions.push((part, *part_position_and_size)); } } if pane_positions.is_empty() { - pane_positions.push((layout.clone(), space_to_split.clone())); + let layout = layout.clone(); + pane_positions.push((layout, space_to_split.clone())); } - pane_positions + Ok(pane_positions) } impl TryFrom<Url> for RunPluginLocation { diff --git a/zellij-utils/src/input/options.rs b/zellij-utils/src/input/options.rs index 93f15b2d..684aabc0 100644 --- a/zellij-utils/src/input/options.rs +++ b/zellij-utils/src/input/options.rs @@ -116,6 +116,11 @@ pub struct Options { #[clap(long, value_parser)] #[serde(default)] pub attach_to_session: Option<bool>, + + /// Whether to lay out panes in a predefined set of layouts whenever possible + #[clap(long, value_parser)] + #[serde(default)] + pub auto_layout: Option<bool>, } #[derive(ArgEnum, Deserialize, Serialize, Debug, Clone, Copy, PartialEq)] @@ -157,6 +162,7 @@ impl Options { pub fn merge(&self, other: Options) -> Options { let mouse_mode = other.mouse_mode.or(self.mouse_mode); let pane_frames = other.pane_frames.or(self.pane_frames); + let auto_layout = other.auto_layout.or(self.auto_layout); let mirror_session = other.mirror_session.or(self.mirror_session); let simplified_ui = other.simplified_ui.or(self.simplified_ui); let default_mode = other.default_mode.or(self.default_mode); @@ -197,6 +203,7 @@ impl Options { scrollback_editor, session_name, attach_to_session, + auto_layout, } } @@ -218,6 +225,7 @@ impl Options { let simplified_ui = merge_bool(other.simplified_ui, self.simplified_ui); let mouse_mode = merge_bool(other.mouse_mode, self.mouse_mode); let pane_frames = merge_bool(other.pane_frames, self.pane_frames); + let auto_layout = merge_bool(other.auto_layout, self.auto_layout); let mirror_session = merge_bool(other.mirror_session, self.mirror_session); let default_mode = other.default_mode.or(self.default_mode); @@ -258,6 +266,7 @@ impl Options { scrollback_editor, session_name, attach_to_session, + auto_layout, } } @@ -288,6 +297,7 @@ impl From<CliOptions> for Options { fn from(cli_options: CliOptions) -> Self { let mut opts = cli_options.options; + // TODO: what? if cli_options.no_pane_frames { opts.pane_frames = Some(false); } diff --git a/zellij-utils/src/input/unit/layout_test.rs b/zellij-utils/src/input/unit/layout_test.rs index d588fcda..f15fd709 100644 --- a/zellij-utils/src/input/unit/layout_test.rs +++ b/zellij-utils/src/input/unit/layout_test.rs @@ -4,9 +4,9 @@ use insta::assert_snapshot; #[test] fn empty_layout() { let kdl_layout = "layout"; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); let expected_layout = Layout { - template: Some(PaneLayout::default()), + template: Some((TiledPaneLayout::default(), vec![])), ..Default::default() }; assert_eq!(layout, expected_layout); @@ -19,12 +19,15 @@ fn layout_with_one_pane() { pane } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); let expected_layout = Layout { - template: Some(PaneLayout { - children: vec![PaneLayout::default()], - ..Default::default() - }), + template: Some(( + TiledPaneLayout { + children: vec![TiledPaneLayout::default()], + ..Default::default() + }, + vec![], + )), ..Default::default() }; assert_eq!(layout, expected_layout); @@ -39,16 +42,19 @@ fn layout_with_multiple_panes() { pane } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); let expected_layout = Layout { - template: Some(PaneLayout { - children: vec![ - PaneLayout::default(), - PaneLayout::default(), - PaneLayout::default(), - ], - ..Default::default() - }), + template: Some(( + TiledPaneLayout { + children: vec![ + TiledPaneLayout::default(), + TiledPaneLayout::default(), + TiledPaneLayout::default(), + ], + ..Default::default() + }, + vec![], + )), ..Default::default() }; assert_eq!(layout, expected_layout); @@ -68,22 +74,25 @@ fn layout_with_nested_panes() { } } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); let expected_layout = Layout { - template: Some(PaneLayout { - children: vec![ - PaneLayout { - children_split_direction: SplitDirection::Vertical, - children: vec![PaneLayout::default(), PaneLayout::default()], - ..Default::default() - }, - PaneLayout { - children: vec![PaneLayout::default(), PaneLayout::default()], - ..Default::default() - }, - ], - ..Default::default() - }), + template: Some(( + TiledPaneLayout { + children: vec![ + TiledPaneLayout { + children_split_direction: SplitDirection::Vertical, + children: vec![TiledPaneLayout::default(), TiledPaneLayout::default()], + ..Default::default() + }, + TiledPaneLayout { + children: vec![TiledPaneLayout::default(), TiledPaneLayout::default()], + ..Default::default() + }, + ], + ..Default::default() + }, + vec![], + )), ..Default::default() }; assert_eq!(layout, expected_layout); @@ -106,32 +115,34 @@ fn layout_with_floating_panes() { } } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); let expected_layout = Layout { - template: Some(PaneLayout::default()), - floating_panes_template: vec![ - FloatingPanesLayout::default(), - FloatingPanesLayout { - x: Some(PercentOrFixed::Fixed(10)), - y: Some(PercentOrFixed::Percent(10)), - width: Some(PercentOrFixed::Fixed(10)), - height: Some(PercentOrFixed::Percent(10)), - ..Default::default() - }, - FloatingPanesLayout { - x: Some(PercentOrFixed::Fixed(10)), - y: Some(PercentOrFixed::Percent(10)), - ..Default::default() - }, - FloatingPanesLayout { - run: Some(Run::Command(RunCommand { - command: PathBuf::from("htop"), - hold_on_close: true, + template: Some(( + TiledPaneLayout::default(), + vec![ + FloatingPaneLayout::default(), + FloatingPaneLayout { + x: Some(PercentOrFixed::Fixed(10)), + y: Some(PercentOrFixed::Percent(10)), + width: Some(PercentOrFixed::Fixed(10)), + height: Some(PercentOrFixed::Percent(10)), ..Default::default() - })), - ..Default::default() - }, - ], + }, + FloatingPaneLayout { + x: Some(PercentOrFixed::Fixed(10)), + y: Some(PercentOrFixed::Percent(10)), + ..Default::default() + }, + FloatingPaneLayout { + run: Some(Run::Command(RunCommand { + command: PathBuf::from("htop"), + hold_on_close: true, + ..Default::default() + })), + ..Default::default() + }, + ], + )), ..Default::default() }; assert_eq!(layout, expected_layout); @@ -148,13 +159,15 @@ fn layout_with_mixed_panes_and_floating_panes() { } } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); let expected_layout = Layout { - template: Some(PaneLayout { - children: vec![PaneLayout::default(), PaneLayout::default()], - ..Default::default() - }), - floating_panes_template: vec![FloatingPanesLayout::default()], + template: Some(( + TiledPaneLayout { + children: vec![TiledPaneLayout::default(), TiledPaneLayout::default()], + ..Default::default() + }, + vec![FloatingPaneLayout::default()], + )), ..Default::default() }; assert_eq!(layout, expected_layout); @@ -175,20 +188,22 @@ fn layout_with_floating_panes_template() { } } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); let expected_layout = Layout { - template: Some(PaneLayout { - children: vec![PaneLayout::default()], - ..Default::default() - }), - floating_panes_template: vec![ - FloatingPanesLayout::default(), - FloatingPanesLayout { - x: Some(PercentOrFixed::Fixed(10)), - y: Some(PercentOrFixed::Percent(10)), + template: Some(( + TiledPaneLayout { + children: vec![TiledPaneLayout::default()], ..Default::default() }, - ], + vec![ + FloatingPaneLayout::default(), + FloatingPaneLayout { + x: Some(PercentOrFixed::Fixed(10)), + y: Some(PercentOrFixed::Percent(10)), + ..Default::default() + }, + ], + )), ..Default::default() }; assert_eq!(layout, expected_layout); @@ -208,30 +223,32 @@ fn layout_with_shared_tiled_and_floating_panes_template() { } } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); let expected_layout = Layout { - template: Some(PaneLayout { - children: vec![PaneLayout { - run: Some(Run::Command(RunCommand { - command: PathBuf::from("htop"), - hold_on_close: true, - ..Default::default() - })), - ..Default::default() - }], - ..Default::default() - }), - floating_panes_template: vec![ - FloatingPanesLayout::default(), - FloatingPanesLayout { - run: Some(Run::Command(RunCommand { - command: PathBuf::from("htop"), - hold_on_close: true, + template: Some(( + TiledPaneLayout { + children: vec![TiledPaneLayout { + run: Some(Run::Command(RunCommand { + command: PathBuf::from("htop"), + hold_on_close: true, + ..Default::default() + })), ..Default::default() - })), + }], ..Default::default() }, - ], + vec![ + FloatingPaneLayout::default(), + FloatingPaneLayout { + run: Some(Run::Command(RunCommand { + command: PathBuf::from("htop"), + hold_on_close: true, + ..Default::default() + })), + ..Default::default() + }, + ], + )), ..Default::default() }; assert_eq!(layout, expected_layout); @@ -254,7 +271,7 @@ fn layout_with_tabs_and_floating_panes() { } } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); assert_snapshot!(format!("{:#?}", layout)); } @@ -265,10 +282,10 @@ fn layout_with_tabs() { tab } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); let expected_layout = Layout { - tabs: vec![(None, PaneLayout::default(), vec![])], - template: Some(PaneLayout::default()), + tabs: vec![(None, TiledPaneLayout::default(), vec![])], + template: Some((TiledPaneLayout::default(), vec![])), ..Default::default() }; assert_eq!(layout, expected_layout); @@ -289,17 +306,17 @@ fn layout_with_nested_differing_tabs() { } } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); let expected_layout = Layout { tabs: vec![ ( None, - PaneLayout { + TiledPaneLayout { children_split_direction: SplitDirection::Vertical, children: vec![ - PaneLayout::default(), - PaneLayout::default(), - PaneLayout::default(), + TiledPaneLayout::default(), + TiledPaneLayout::default(), + TiledPaneLayout::default(), ], ..Default::default() }, @@ -307,15 +324,15 @@ fn layout_with_nested_differing_tabs() { ), ( None, - PaneLayout { + TiledPaneLayout { children_split_direction: SplitDirection::Horizontal, - children: vec![PaneLayout::default(), PaneLayout::default()], + children: vec![TiledPaneLayout::default(), TiledPaneLayout::default()], ..Default::default() }, vec![], // floating panes ), ], - template: Some(PaneLayout::default()), + template: Some((TiledPaneLayout::default(), vec![])), ..Default::default() }; assert_eq!(layout, expected_layout); @@ -331,29 +348,32 @@ fn layout_with_panes_in_different_mixed_split_sizes() { pane size=2; } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); let expected_layout = Layout { - template: Some(PaneLayout { - children: vec![ - PaneLayout { - split_size: Some(SplitSize::Fixed(1)), - ..Default::default() - }, - PaneLayout { - split_size: Some(SplitSize::Percent(10)), - ..Default::default() - }, - PaneLayout { - split_size: None, - ..Default::default() - }, - PaneLayout { - split_size: Some(SplitSize::Fixed(2)), - ..Default::default() - }, - ], - ..Default::default() - }), + template: Some(( + TiledPaneLayout { + children: vec![ + TiledPaneLayout { + split_size: Some(SplitSize::Fixed(1)), + ..Default::default() + }, + TiledPaneLayout { + split_size: Some(SplitSize::Percent(10)), + ..Default::default() + }, + TiledPaneLayout { + split_size: None, + ..Default::default() + }, + TiledPaneLayout { + split_size: Some(SplitSize::Fixed(2)), + ..Default::default() + }, + ], + ..Default::default() + }, + vec![], + )), ..Default::default() }; assert_eq!(layout, expected_layout); @@ -366,19 +386,22 @@ fn layout_with_command_panes() { pane command="htop" } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); let expected_layout = Layout { - template: Some(PaneLayout { - children: vec![PaneLayout { - run: Some(Run::Command(RunCommand { - command: PathBuf::from("htop"), - hold_on_close: true, + template: Some(( + TiledPaneLayout { + children: vec![TiledPaneLayout { + run: Some(Run::Command(RunCommand { + command: PathBuf::from("htop"), + hold_on_close: true, + ..Default::default() + })), ..Default::default() - })), + }], ..Default::default() - }], - ..Default::default() - }), + }, + vec![], + )), ..Default::default() }; assert_eq!(layout, expected_layout); @@ -391,20 +414,23 @@ fn layout_with_command_panes_and_cwd() { pane command="htop" cwd="/path/to/my/cwd" } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); let expected_layout = Layout { - template: Some(PaneLayout { - children: vec![PaneLayout { - run: Some(Run::Command(RunCommand { - command: PathBuf::from("htop"), - cwd: Some(PathBuf::from("/path/to/my/cwd")), - hold_on_close: true, + template: Some(( + TiledPaneLayout { + children: vec![TiledPaneLayout { + run: Some(Run::Command(RunCommand { + command: PathBuf::from("htop"), + cwd: Some(PathBuf::from("/path/to/my/cwd")), + hold_on_close: true, + ..Default::default() + })), ..Default::default() - })), + }], ..Default::default() - }], - ..Default::default() - }), + }, + vec![], + )), ..Default::default() }; assert_eq!(layout, expected_layout); @@ -419,21 +445,24 @@ fn layout_with_command_panes_and_cwd_and_args() { } } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); let expected_layout = Layout { - template: Some(PaneLayout { - children: vec![PaneLayout { - run: Some(Run::Command(RunCommand { - command: PathBuf::from("htop"), - cwd: Some(PathBuf::from("/path/to/my/cwd")), - args: vec![String::from("-h"), String::from("-v")], - hold_on_close: true, + template: Some(( + TiledPaneLayout { + children: vec![TiledPaneLayout { + run: Some(Run::Command(RunCommand { + command: PathBuf::from("htop"), + cwd: Some(PathBuf::from("/path/to/my/cwd")), + args: vec![String::from("-h"), String::from("-v")], + hold_on_close: true, + ..Default::default() + })), ..Default::default() - })), + }], ..Default::default() - }], - ..Default::default() - }), + }, + vec![], + )), ..Default::default() }; assert_eq!(layout, expected_layout); @@ -448,7 +477,7 @@ fn layout_with_command_panes_and_close_on_exit() { } } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); assert_snapshot!(format!("{:#?}", layout)); } @@ -461,7 +490,7 @@ fn layout_with_command_panes_and_start_suspended() { } } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); assert_snapshot!(format!("{:#?}", layout)); } @@ -477,27 +506,32 @@ fn layout_with_plugin_panes() { } } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); let expected_layout = Layout { - template: Some(PaneLayout { - children: vec![ - PaneLayout { - run: Some(Run::Plugin(RunPlugin { - location: RunPluginLocation::Zellij(PluginTag::new("tab-bar")), - _allow_exec_host_cmd: false, - })), - ..Default::default() - }, - PaneLayout { - run: Some(Run::Plugin(RunPlugin { - location: RunPluginLocation::File(PathBuf::from("/path/to/my/plugin.wasm")), - _allow_exec_host_cmd: false, - })), - ..Default::default() - }, - ], - ..Default::default() - }), + template: Some(( + TiledPaneLayout { + children: vec![ + TiledPaneLayout { + run: Some(Run::Plugin(RunPlugin { + location: RunPluginLocation::Zellij(PluginTag::new("tab-bar")), + _allow_exec_host_cmd: false, + })), + ..Default::default() + }, + TiledPaneLayout { + run: Some(Run::Plugin(RunPlugin { + location: RunPluginLocation::File(PathBuf::from( + "/path/to/my/plugin.wasm", + )), + _allow_exec_host_cmd: false, + })), + ..Default::default() + }, + ], + ..Default::default() + }, + vec![], + )), ..Default::default() }; assert_eq!(layout, expected_layout); @@ -510,15 +544,18 @@ fn layout_with_borderless_panes() { pane borderless=true } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); let expected_layout = Layout { - template: Some(PaneLayout { - children: vec![PaneLayout { - borderless: true, + template: Some(( + TiledPaneLayout { + children: vec![TiledPaneLayout { + borderless: true, + ..Default::default() + }], ..Default::default() - }], - ..Default::default() - }), + }, + vec![], + )), ..Default::default() }; assert_eq!(layout, expected_layout); @@ -531,15 +568,18 @@ fn layout_with_focused_panes() { pane focus=true } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); let expected_layout = Layout { - template: Some(PaneLayout { - children: vec![PaneLayout { - focus: Some(true), + template: Some(( + TiledPaneLayout { + children: vec![TiledPaneLayout { + focus: Some(true), + ..Default::default() + }], ..Default::default() - }], - ..Default::default() - }), + }, + vec![], + )), ..Default::default() }; assert_eq!(layout, expected_layout); @@ -552,15 +592,18 @@ fn layout_with_pane_names() { pane name="my awesome pane" } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); let expected_layout = Layout { - template: Some(PaneLayout { - children: vec![PaneLayout { - name: Some("my awesome pane".into()), + template: Some(( + TiledPaneLayout { + children: vec![TiledPaneLayout { + name: Some("my awesome pane".into()), + ..Default::default() + }], ..Default::default() - }], - ..Default::default() - }), + }, + vec![], + )), ..Default::default() }; assert_eq!(layout, expected_layout); @@ -574,12 +617,12 @@ fn layout_with_tab_names() { tab name="my cool tab name 2" } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); let expected_layout = Layout { tabs: vec![ ( Some("my cool tab name 1".into()), - PaneLayout { + TiledPaneLayout { children: vec![], ..Default::default() }, @@ -587,14 +630,14 @@ fn layout_with_tab_names() { ), ( Some("my cool tab name 2".into()), - PaneLayout { + TiledPaneLayout { children: vec![], ..Default::default() }, vec![], // floating panes ), ], - template: Some(PaneLayout::default()), + template: Some((TiledPaneLayout::default(), vec![])), ..Default::default() }; assert_eq!(layout, expected_layout); @@ -609,14 +652,14 @@ fn layout_with_focused_tab() { tab } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); let expected_layout = Layout { tabs: vec![ - (None, PaneLayout::default(), vec![]), - (None, PaneLayout::default(), vec![]), - (None, PaneLayout::default(), vec![]), + (None, TiledPaneLayout::default(), vec![]), + (None, TiledPaneLayout::default(), vec![]), + (None, TiledPaneLayout::default(), vec![]), ], - template: Some(PaneLayout::default()), + template: Some((TiledPaneLayout::default(), vec![])), focused_tab_index: Some(1), ..Default::default() }; @@ -643,21 +686,21 @@ fn layout_with_tab_templates() { one-above-one-below } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); let expected_layout = Layout { tabs: vec![ ( Some("my first tab".into()), - PaneLayout { + TiledPaneLayout { children_split_direction: SplitDirection::Horizontal, children: vec![ - PaneLayout::default(), - PaneLayout { + TiledPaneLayout::default(), + TiledPaneLayout { children_split_direction: SplitDirection::Vertical, - children: vec![PaneLayout::default(), PaneLayout::default()], + children: vec![TiledPaneLayout::default(), TiledPaneLayout::default()], ..Default::default() }, - PaneLayout::default(), + TiledPaneLayout::default(), ], ..Default::default() }, @@ -665,16 +708,16 @@ fn layout_with_tab_templates() { ), ( Some("my second tab".into()), - PaneLayout { + TiledPaneLayout { children_split_direction: SplitDirection::Horizontal, children: vec![ - PaneLayout::default(), - PaneLayout { + TiledPaneLayout::default(), + TiledPaneLayout { children_split_direction: SplitDirection::Horizontal, - children: vec![PaneLayout::default(), PaneLayout::default()], + children: vec![TiledPaneLayout::default(), TiledPaneLayout::default()], ..Default::default() }, - PaneLayout::default(), + TiledPaneLayout::default(), ], ..Default::default() }, @@ -682,19 +725,19 @@ fn layout_with_tab_templates() { ), ( None, - PaneLayout { + TiledPaneLayout { children_split_direction: SplitDirection::Horizontal, children: vec![ - PaneLayout::default(), - PaneLayout::default(), - PaneLayout::default(), + TiledPaneLayout::default(), + TiledPaneLayout::default(), + TiledPaneLayout::default(), ], ..Default::default() }, vec![], // floating panes ), ], - template: Some(PaneLayout::default()), + template: Some((TiledPaneLayout::default(), vec![])), ..Default::default() }; assert_eq!(layout, expected_layout); @@ -720,7 +763,7 @@ fn layout_with_default_tab_template() { tab } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); assert_snapshot!(format!("{:#?}", layout)); } @@ -747,7 +790,7 @@ fn layout_with_pane_templates() { left-and-right } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); assert_snapshot!(format!("{:#?}", layout)); } @@ -768,7 +811,7 @@ fn layout_with_tab_and_pane_templates() { left-right-and-htop } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); assert_snapshot!(format!("{:#?}", layout)); } @@ -789,7 +832,7 @@ fn layout_with_nested_pane_templates() { left-and-right } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); assert_snapshot!(format!("{:#?}", layout)); } @@ -815,7 +858,7 @@ fn layout_with_nested_branched_pane_templates() { left-and-right } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); assert_snapshot!(format!("{:#?}", layout)); } @@ -839,7 +882,7 @@ fn circular_dependency_pane_templates_error() { one } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None); assert!(layout.is_err(), "circular dependency detected"); } @@ -861,7 +904,7 @@ fn children_not_as_first_child_of_tab_template() { horizontal-with-vertical-top } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); assert_snapshot!(format!("{:#?}", layout)); } @@ -884,7 +927,7 @@ fn error_on_more_than_one_children_block_in_tab_template() { horizontal-with-vertical-top } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None); assert!( layout.is_err(), "error provided for more than one children block" @@ -909,7 +952,7 @@ fn children_not_as_first_child_of_pane_template() { horizontal-with-vertical-top } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); assert_snapshot!(format!("{:#?}", layout)); } @@ -932,7 +975,7 @@ fn error_on_more_than_one_children_block_in_pane_template() { horizontal-with-vertical-top } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None); assert!( layout.is_err(), "error provided for more than one children block" @@ -961,7 +1004,7 @@ fn combined_tab_and_pane_template_both_with_children() { horizontal-with-vertical-top } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); assert_snapshot!(format!("{:#?}", layout)); } @@ -977,7 +1020,7 @@ fn cannot_define_tab_template_name_with_space() { pane } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None); assert!(layout.is_err(), "error provided for tab name with space"); } @@ -993,7 +1036,7 @@ fn cannot_define_pane_template_name_with_space() { pane } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None); assert!(layout.is_err(), "error provided for tab name with space"); } @@ -1007,7 +1050,7 @@ fn cannot_define_panes_and_tabs_on_same_level() { } } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None); assert!( layout.is_err(), "error provided for tab and pane on the same level" @@ -1041,7 +1084,7 @@ fn cannot_define_tab_template_names_as_keywords() { ", keyword ); - let layout = Layout::from_kdl(&kdl_layout, "layout_file_name".into(), None); + let layout = Layout::from_kdl(&kdl_layout, "layout_file_name".into(), None, None); assert!( layout.is_err(), "{}", @@ -1079,7 +1122,7 @@ fn cannot_define_pane_template_names_as_keywords() { ", keyword ); - let layout = Layout::from_kdl(&kdl_layout, "layout_file_name".into(), None); + let layout = Layout::from_kdl(&kdl_layout, "layout_file_name".into(), None, None); assert!( layout.is_err(), "{}", @@ -1099,7 +1142,8 @@ fn error_on_multiple_layout_nodes_in_file() { layout " ); - let layout_error = Layout::from_kdl(&kdl_layout, "layout_file_name".into(), None).unwrap_err(); + let layout_error = + Layout::from_kdl(&kdl_layout, "layout_file_name".into(), None, None).unwrap_err(); assert_snapshot!(format!("{:?}", layout_error)); } @@ -1114,7 +1158,8 @@ fn error_on_unknown_layout_node() { }} " ); - let layout_error = Layout::from_kdl(&kdl_layout, "layout_file_name".into(), None).unwrap_err(); + let layout_error = + Layout::from_kdl(&kdl_layout, "layout_file_name".into(), None, None).unwrap_err(); assert_snapshot!(format!("{:?}", layout_error)); } @@ -1127,7 +1172,8 @@ fn error_on_unknown_layout_pane_property() { }} " ); - let layout_error = Layout::from_kdl(&kdl_layout, "layout_file_name".into(), None).unwrap_err(); + let layout_error = + Layout::from_kdl(&kdl_layout, "layout_file_name".into(), None, None).unwrap_err(); assert_snapshot!(format!("{:?}", layout_error)); } @@ -1140,7 +1186,8 @@ fn error_on_unknown_layout_pane_template_property() { }} " ); - let layout_error = Layout::from_kdl(&kdl_layout, "layout_file_name".into(), None).unwrap_err(); + let layout_error = + Layout::from_kdl(&kdl_layout, "layout_file_name".into(), None, None).unwrap_err(); assert_snapshot!(format!("{:?}", layout_error)); } @@ -1153,7 +1200,8 @@ fn error_on_unknown_layout_tab_property() { }} " ); - let layout_error = Layout::from_kdl(&kdl_layout, "layout_file_name".into(), None).unwrap_err(); + let layout_error = + Layout::from_kdl(&kdl_layout, "layout_file_name".into(), None, None).unwrap_err(); assert_snapshot!(format!("{:?}", layout_error)); } @@ -1166,7 +1214,8 @@ fn error_on_unknown_layout_tab_template_property() { }} " ); - let layout_error = Layout::from_kdl(&kdl_layout, "layout_file_name".into(), None).unwrap_err(); + let layout_error = + Layout::from_kdl(&kdl_layout, "layout_file_name".into(), None, None).unwrap_err(); assert_snapshot!(format!("{:?}", layout_error)); } @@ -1183,7 +1232,8 @@ fn error_on_pane_templates_without_a_name() { }} " ); - let layout_error = Layout::from_kdl(&kdl_layout, "layout_file_name".into(), None).unwrap_err(); + let layout_error = + Layout::from_kdl(&kdl_layout, "layout_file_name".into(), None, None).unwrap_err(); assert_snapshot!(format!("{:?}", layout_error)); } @@ -1200,7 +1250,8 @@ fn error_on_tab_templates_without_a_name() { }} " ); - let layout_error = Layout::from_kdl(&kdl_layout, "layout_file_name".into(), None).unwrap_err(); + let layout_error = + Layout::from_kdl(&kdl_layout, "layout_file_name".into(), None, None).unwrap_err(); assert_snapshot!(format!("{:?}", layout_error)); } @@ -1213,7 +1264,8 @@ fn error_on_more_than_one_focused_tab() { tab } "#; - let layout_error = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap_err(); + let layout_error = + Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap_err(); assert_snapshot!(format!("{:?}", layout_error)); } @@ -1231,7 +1283,7 @@ fn args_override_args_in_template() { } } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); assert_snapshot!(format!("{:#?}", layout)); } @@ -1249,7 +1301,7 @@ fn close_on_exit_overrides_close_on_exit_in_template() { } } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); assert_snapshot!(format!("{:#?}", layout)); } @@ -1266,7 +1318,7 @@ fn args_added_to_args_in_template() { } } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); assert_snapshot!(format!("{:#?}", layout)); } @@ -1283,7 +1335,7 @@ fn close_on_exit_added_to_close_on_exit_in_template() { } } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); assert_snapshot!(format!("{:#?}", layout)); } @@ -1301,7 +1353,7 @@ fn cwd_override_cwd_in_template() { } } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); assert_snapshot!(format!("{:#?}", layout)); } @@ -1318,7 +1370,7 @@ fn cwd_added_to_cwd_in_template() { } } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); assert_snapshot!(format!("{:#?}", layout)); } @@ -1331,7 +1383,7 @@ fn error_on_mixed_command_and_child_panes() { } } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None); assert!(layout.is_err(), "error provided"); } @@ -1345,7 +1397,7 @@ fn error_on_mixed_cwd_and_child_panes() { } } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None); assert!(layout.is_err(), "error provided"); } @@ -1358,7 +1410,7 @@ fn error_on_bare_args_without_command() { } } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None); assert!(layout.is_err(), "error provided"); } @@ -1371,7 +1423,7 @@ fn error_on_bare_close_on_exit_without_command() { } } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None); assert!(layout.is_err(), "error provided"); } @@ -1385,7 +1437,7 @@ fn error_on_bare_args_in_template_without_command() { } } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None); assert!(layout.is_err(), "error provided"); } @@ -1399,7 +1451,7 @@ fn error_on_bare_close_on_exit_in_template_without_command() { } } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None); assert!(layout.is_err(), "error provided"); } @@ -1418,7 +1470,7 @@ fn pane_template_command_with_cwd_overriden_by_its_consumers_command_cwd() { // pane should have /tmp/foo and not /tmp/bar as cwd } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); assert_snapshot!(format!("{:#?}", layout)); } @@ -1435,7 +1487,7 @@ fn pane_template_command_with_cwd_remains_when_its_consumer_command_does_not_hav // pane should have /tmp/bar as its cwd with the pwd command } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); assert_snapshot!(format!("{:#?}", layout)); } @@ -1453,7 +1505,7 @@ fn pane_template_command_without_cwd_is_overriden_by_its_consumers_cwd() { // pane should have /tmp/bar as its cwd with the pwd command } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); assert_snapshot!(format!("{:#?}", layout)); } @@ -1472,7 +1524,7 @@ fn pane_template_command_with_cwd_is_overriden_by_its_consumers_bare_cwd() { // pane should have /tmp/bar as its cwd with the tail command } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); assert_snapshot!(format!("{:#?}", layout)); } @@ -1490,7 +1542,7 @@ fn pane_template_command_without_cwd_receives_its_consumers_bare_cwd() { // pane should have /tmp/bar as its cwd with the tail command } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); assert_snapshot!(format!("{:#?}", layout)); } @@ -1508,7 +1560,7 @@ fn pane_template_with_bare_cwd_overriden_by_its_consumers_bare_cwd() { // pane should have /tmp/foo without a command } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); assert_snapshot!(format!("{:#?}", layout)); } @@ -1524,7 +1576,7 @@ fn pane_template_with_bare_propagated_to_its_consumer_command_without_cwd() { // pane should have /tmp/foo with the tail command } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); assert_snapshot!(format!("{:#?}", layout)); } @@ -1542,7 +1594,7 @@ fn pane_template_with_bare_propagated_to_its_consumer_command_with_cwd() { // pane should have /tmp/bar with the tail command } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); assert_snapshot!(format!("{:#?}", layout)); } @@ -1558,7 +1610,7 @@ fn pane_template_with_bare_propagated_to_its_consumer_edit() { // pane should have /tmp/foo/bar with the edit file variant } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); assert_snapshot!(format!("{:#?}", layout)); } @@ -1574,7 +1626,7 @@ fn pane_template_with_command_propagated_to_its_consumer_edit() { // pane should have /tmp/foo/bar with the edit file variant } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); assert_snapshot!(format!("{:#?}", layout)); } @@ -1588,7 +1640,7 @@ fn global_cwd_given_to_panes_without_cwd() { // both should have the /tmp cwd } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); assert_snapshot!(format!("{:#?}", layout)); } @@ -1601,7 +1653,7 @@ fn global_cwd_prepended_to_panes_with_cwd() { pane command="tail" cwd="/home/foo" // should be /home/foo because its an absolute path } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); assert_snapshot!(format!("{:#?}", layout)); } @@ -1618,6 +1670,7 @@ fn global_cwd_passed_from_layout_constructor() { let layout = Layout::from_kdl( kdl_layout, "layout_file_name".into(), + None, Some(PathBuf::from("/tmp")), ) .unwrap(); @@ -1638,6 +1691,7 @@ fn global_cwd_passed_from_layout_constructor_overrides_global_cwd_in_layout_file let layout = Layout::from_kdl( kdl_layout, "layout_file_name".into(), + None, Some(PathBuf::from("/tmp")), ) .unwrap(); @@ -1656,7 +1710,7 @@ fn global_cwd_with_tab_cwd_given_to_panes_without_cwd() { // both should have the /tmp/foo cwd } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); assert_snapshot!(format!("{:#?}", layout)); } @@ -1671,7 +1725,7 @@ fn tab_cwd_given_to_panes_without_cwd() { // both should have the /tmp cwd } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); assert_snapshot!(format!("{:#?}", layout)); } @@ -1686,7 +1740,7 @@ fn tab_cwd_prepended_to_panes_with_cwd() { // both should have the /tmp/foo cwd } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); assert_snapshot!(format!("{:#?}", layout)); } @@ -1701,7 +1755,7 @@ fn global_cwd_and_tab_cwd_prepended_to_panes_with_and_without_cwd() { } } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); assert_snapshot!(format!("{:#?}", layout)); } @@ -1722,7 +1776,7 @@ fn global_cwd_and_tab_cwd_prepended_to_panes_with_and_without_cwd_in_pane_templa } } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); assert_snapshot!(format!("{:#?}", layout)); } @@ -1741,6 +1795,57 @@ fn global_cwd_and_tab_cwd_prepended_to_panes_with_and_without_cwd_in_tab_templat } } "#; - let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None).unwrap(); + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); + assert_snapshot!(format!("{:#?}", layout)); +} + +#[test] +fn can_load_swap_layouts_from_a_different_file() { + let kdl_layout = r#" + layout { + // here we define a tab_template in the main layout and later make sure we can sue it + // in the swap layouts + tab_template name="ui" { + pane size=1 borderless=true { + plugin location="zellij:tab-bar" + } + children + pane size=2 borderless=true { + plugin location="zellij:status-bar" + } + } + pane + } + "#; + let kdl_swap_layout = r#" + swap_tiled_layout name="vertical" { + ui max_panes=5 { + pane split_direction="vertical" { + pane + pane { children; } + } + } + ui max_panes=8 { + pane split_direction="vertical" { + pane { children; } + pane { pane; pane; pane; pane; } + } + } + ui max_panes=12 { + pane split_direction="vertical" { + pane { children; } + pane { pane; pane; pane; pane; } + pane { pane; pane; pane; pane; } + } + } + } + "#; + let layout = Layout::from_kdl( + kdl_layout, + "layout_file_name".into(), + Some(("swap_layout_file_name".into(), kdl_swap_layout)), + None, + ) + .unwrap(); assert_snapshot!(format!("{:#?}", layout)); } diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__args_added_to_args_in_template.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__args_added_to_args_in_template.snap index 0fc51aad..79990832 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__args_added_to_args_in_template.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__args_added_to_args_in_template.snap @@ -1,66 +1,74 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 1101 +assertion_line: 1266 expression: "format!(\"{:#?}\", layout)" --- Layout { tabs: [], focused_tab_index: None, template: Some( - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [ - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: Some( - Command( - RunCommand { - command: "tail", - args: [], - cwd: None, - hold_on_close: true, - hold_on_start: false, - }, + ( + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: Some( + Command( + RunCommand { + command: "tail", + args: [], + cwd: None, + hold_on_close: true, + hold_on_start: false, + }, + ), ), - ), - borderless: false, - focus: None, - external_children_index: None, - }, - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: Some( - Command( - RunCommand { - command: "tail", - args: [ - "-f", - "/tmp/bar", - ], - cwd: None, - hold_on_close: true, - hold_on_start: false, - }, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: Some( + Command( + RunCommand { + command: "tail", + args: [ + "-f", + "/tmp/bar", + ], + cwd: None, + hold_on_close: true, + hold_on_start: false, + }, + ), ), - ), - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + [], + ), ), - floating_panes_template: [], + swap_layouts: [], + swap_tiled_layouts: [], + swap_floating_layouts: [], } diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__args_override_args_in_template.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__args_override_args_in_template.snap index 64d47573..bb691fe7 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__args_override_args_in_template.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__args_override_args_in_template.snap @@ -1,69 +1,77 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 1066 +assertion_line: 1231 expression: "format!(\"{:#?}\", layout)" --- Layout { tabs: [], focused_tab_index: None, template: Some( - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [ - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: Some( - Command( - RunCommand { - command: "tail", - args: [ - "-f", - "/tmp/foo", - ], - cwd: None, - hold_on_close: true, - hold_on_start: false, - }, + ( + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: Some( + Command( + RunCommand { + command: "tail", + args: [ + "-f", + "/tmp/foo", + ], + cwd: None, + hold_on_close: true, + hold_on_start: false, + }, + ), ), - ), - borderless: false, - focus: None, - external_children_index: None, - }, - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: Some( - Command( - RunCommand { - command: "tail", - args: [ - "-f", - "/tmp/bar", - ], - cwd: None, - hold_on_close: true, - hold_on_start: false, - }, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: Some( + Command( + RunCommand { + command: "tail", + args: [ + "-f", + "/tmp/bar", + ], + cwd: None, + hold_on_close: true, + hold_on_start: false, + }, + ), ), - ), - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + [], + ), ), - floating_panes_template: [], + swap_layouts: [], + swap_tiled_layouts: [], + swap_floating_layouts: [], } diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__can_load_swap_layouts_from_a_different_file.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__can_load_swap_layouts_from_a_different_file.snap new file mode 100644 index 00000000..be292b58 --- /dev/null +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__can_load_swap_layouts_from_a_different_file.snap @@ -0,0 +1,536 @@ +--- +source: zellij-utils/src/input/./unit/layout_test.rs +assertion_line: 1788 +expression: "format!(\"{:#?}\", layout)" +--- +Layout { + tabs: [], + focused_tab_index: None, + template: Some( + ( + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + [], + ), + ), + swap_layouts: [], + swap_tiled_layouts: [ + ( + { + MaxPanes( + 5, + ): TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: Some( + Fixed( + 1, + ), + ), + run: Some( + Plugin( + RunPlugin { + _allow_exec_host_cmd: false, + location: Zellij( + PluginTag( + "tab-bar", + ), + ), + }, + ), + ), + borderless: true, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Vertical, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: Some( + 0, + ), + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: Some( + Fixed( + 2, + ), + ), + run: Some( + Plugin( + RunPlugin { + _allow_exec_host_cmd: false, + location: Zellij( + PluginTag( + "status-bar", + ), + ), + }, + ), + ), + borderless: true, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + MaxPanes( + 8, + ): TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: Some( + Fixed( + 1, + ), + ), + run: Some( + Plugin( + RunPlugin { + _allow_exec_host_cmd: false, + location: Zellij( + PluginTag( + "tab-bar", + ), + ), + }, + ), + ), + borderless: true, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Vertical, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: Some( + 0, + ), + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: Some( + Fixed( + 2, + ), + ), + run: Some( + Plugin( + RunPlugin { + _allow_exec_host_cmd: false, + location: Zellij( + PluginTag( + "status-bar", + ), + ), + }, + ), + ), + borderless: true, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + MaxPanes( + 12, + ): TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: Some( + Fixed( + 1, + ), + ), + run: Some( + Plugin( + RunPlugin { + _allow_exec_host_cmd: false, + location: Zellij( + PluginTag( + "tab-bar", + ), + ), + }, + ), + ), + borderless: true, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Vertical, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: Some( + 0, + ), + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: Some( + Fixed( + 2, + ), + ), + run: Some( + Plugin( + RunPlugin { + _allow_exec_host_cmd: false, + location: Zellij( + PluginTag( + "status-bar", + ), + ), + }, + ), + ), + borderless: true, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + }, + Some( + "vertical", + ), + ), + ], + swap_floating_layouts: [], +} diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__children_not_as_first_child_of_pane_template.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__children_not_as_first_child_of_pane_template.snap index 36eeb717..304f0169 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__children_not_as_first_child_of_pane_template.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__children_not_as_first_child_of_pane_template.snap @@ -1,142 +1,159 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 744 +assertion_line: 909 expression: "format!(\"{:#?}\", layout)" --- Layout { tabs: [], focused_tab_index: None, template: Some( - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [ - PaneLayout { - children_split_direction: Horizontal, - name: Some( - "my pane", - ), - children: [ - PaneLayout { - children_split_direction: Vertical, - name: None, - children: [ - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [ - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [ - PaneLayout { - children_split_direction: Vertical, - name: None, - children: [ - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: Some( - 1, - ), - }, - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, + ( + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: Some( + "my pane", + ), + children: [ + TiledPaneLayout { + children_split_direction: Vertical, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Vertical, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: Some( + 1, + ), + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + [], + ), ), - floating_panes_template: [], + swap_layouts: [], + swap_tiled_layouts: [], + swap_floating_layouts: [], } diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__children_not_as_first_child_of_tab_template.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__children_not_as_first_child_of_tab_template.snap index ac027457..ded8fd1f 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__children_not_as_first_child_of_tab_template.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__children_not_as_first_child_of_tab_template.snap @@ -1,6 +1,6 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 696 +assertion_line: 861 expression: "format!(\"{:#?}\", layout)" --- Layout { @@ -9,15 +9,15 @@ Layout { Some( "my tab", ), - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [ - PaneLayout { + TiledPaneLayout { children_split_direction: Vertical, name: None, children: [ - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -26,12 +26,13 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [ - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -40,8 +41,9 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -50,6 +52,7 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, ], split_size: None, @@ -57,6 +60,7 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, ], split_size: None, @@ -64,8 +68,9 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -74,6 +79,7 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, ], split_size: None, @@ -81,20 +87,21 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, [], ), ( None, - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [ - PaneLayout { + TiledPaneLayout { children_split_direction: Vertical, name: None, children: [ - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -103,6 +110,7 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, ], split_size: None, @@ -112,8 +120,9 @@ Layout { external_children_index: Some( 1, ), + children_are_stacked: false, }, - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -122,6 +131,7 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, ], split_size: None, @@ -129,22 +139,29 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, [], ), ], focused_tab_index: None, template: Some( - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, + ( + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + [], + ), ), - floating_panes_template: [], + swap_layouts: [], + swap_tiled_layouts: [], + swap_floating_layouts: [], } diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__close_on_exit_added_to_close_on_exit_in_template.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__close_on_exit_added_to_close_on_exit_in_template.snap index 0386fd19..b7ed1fe8 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__close_on_exit_added_to_close_on_exit_in_template.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__close_on_exit_added_to_close_on_exit_in_template.snap @@ -1,63 +1,71 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 1118 +assertion_line: 1283 expression: "format!(\"{:#?}\", layout)" --- Layout { tabs: [], focused_tab_index: None, template: Some( - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [ - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: Some( - Command( - RunCommand { - command: "tail", - args: [], - cwd: None, - hold_on_close: true, - hold_on_start: false, - }, + ( + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: Some( + Command( + RunCommand { + command: "tail", + args: [], + cwd: None, + hold_on_close: true, + hold_on_start: false, + }, + ), ), - ), - borderless: false, - focus: None, - external_children_index: None, - }, - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: Some( - Command( - RunCommand { - command: "tail", - args: [], - cwd: None, - hold_on_close: false, - hold_on_start: false, - }, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: Some( + Command( + RunCommand { + command: "tail", + args: [], + cwd: None, + hold_on_close: false, + hold_on_start: false, + }, + ), ), - ), - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + [], + ), ), - floating_panes_template: [], + swap_layouts: [], + swap_tiled_layouts: [], + swap_floating_layouts: [], } diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__close_on_exit_overrides_close_on_exit_in_template.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__close_on_exit_overrides_close_on_exit_in_template.snap index 487bfb82..b0c35796 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__close_on_exit_overrides_close_on_exit_in_template.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__close_on_exit_overrides_close_on_exit_in_template.snap @@ -1,63 +1,71 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 1084 +assertion_line: 1249 expression: "format!(\"{:#?}\", layout)" --- Layout { tabs: [], focused_tab_index: None, template: Some( - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [ - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: Some( - Command( - RunCommand { - command: "tail", - args: [], - cwd: None, - hold_on_close: true, - hold_on_start: false, - }, + ( + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: Some( + Command( + RunCommand { + command: "tail", + args: [], + cwd: None, + hold_on_close: true, + hold_on_start: false, + }, + ), ), - ), - borderless: false, - focus: None, - external_children_index: None, - }, - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: Some( - Command( - RunCommand { - command: "tail", - args: [], - cwd: None, - hold_on_close: false, - hold_on_start: false, - }, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: Some( + Command( + RunCommand { + command: "tail", + args: [], + cwd: None, + hold_on_close: false, + hold_on_start: false, + }, + ), ), - ), - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + [], + ), ), - floating_panes_template: [], + swap_layouts: [], + swap_tiled_layouts: [], + swap_floating_layouts: [], } diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__combined_tab_and_pane_template_both_with_children.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__combined_tab_and_pane_template_both_with_children.snap index 0c4cb680..ad335416 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__combined_tab_and_pane_template_both_with_children.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__combined_tab_and_pane_template_both_with_children.snap @@ -1,6 +1,6 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 796 +assertion_line: 961 expression: "format!(\"{:#?}\", layout)" --- Layout { @@ -9,15 +9,15 @@ Layout { Some( "my tab", ), - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [ - PaneLayout { + TiledPaneLayout { children_split_direction: Vertical, name: None, children: [ - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -26,12 +26,13 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [ - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: Some( "middle", @@ -42,6 +43,7 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, ], split_size: None, @@ -49,8 +51,9 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -59,6 +62,7 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, ], split_size: None, @@ -66,12 +70,13 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [ - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -80,8 +85,9 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -90,6 +96,7 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, ], split_size: None, @@ -97,6 +104,7 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, ], split_size: None, @@ -104,20 +112,21 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, [], ), ( None, - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [ - PaneLayout { + TiledPaneLayout { children_split_direction: Vertical, name: None, children: [ - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -126,12 +135,13 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [ - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: Some( "middle", @@ -142,6 +152,7 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, ], split_size: None, @@ -149,8 +160,9 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -159,6 +171,7 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, ], split_size: None, @@ -166,8 +179,9 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -176,6 +190,7 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, ], split_size: None, @@ -183,22 +198,29 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, [], ), ], focused_tab_index: None, template: Some( - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, + ( + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + [], + ), ), - floating_panes_template: [], + swap_layouts: [], + swap_tiled_layouts: [], + swap_floating_layouts: [], } diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__cwd_added_to_cwd_in_template.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__cwd_added_to_cwd_in_template.snap index beb1f67f..1940a648 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__cwd_added_to_cwd_in_template.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__cwd_added_to_cwd_in_template.snap @@ -1,65 +1,73 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 1153 +assertion_line: 1318 expression: "format!(\"{:#?}\", layout)" --- Layout { tabs: [], focused_tab_index: None, template: Some( - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [ - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: Some( - Command( - RunCommand { - command: "tail", - args: [], - cwd: None, - hold_on_close: true, - hold_on_start: false, - }, + ( + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: Some( + Command( + RunCommand { + command: "tail", + args: [], + cwd: None, + hold_on_close: true, + hold_on_start: false, + }, + ), ), - ), - borderless: false, - focus: None, - external_children_index: None, - }, - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: Some( - Command( - RunCommand { - command: "tail", - args: [], - cwd: Some( - "/home", - ), - hold_on_close: true, - hold_on_start: false, - }, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: Some( + Command( + RunCommand { + command: "tail", + args: [], + cwd: Some( + "/home", + ), + hold_on_close: true, + hold_on_start: false, + }, + ), ), - ), - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + [], + ), ), - floating_panes_template: [], + swap_layouts: [], + swap_tiled_layouts: [], + swap_floating_layouts: [], } diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__cwd_override_cwd_in_template.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__cwd_override_cwd_in_template.snap index 36cc0c24..f89eb14e 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__cwd_override_cwd_in_template.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__cwd_override_cwd_in_template.snap @@ -1,67 +1,75 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 1136 +assertion_line: 1301 expression: "format!(\"{:#?}\", layout)" --- Layout { tabs: [], focused_tab_index: None, template: Some( - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [ - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: Some( - Command( - RunCommand { - command: "tail", - args: [], - cwd: Some( - "/tmp", - ), - hold_on_close: true, - hold_on_start: false, - }, + ( + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: Some( + Command( + RunCommand { + command: "tail", + args: [], + cwd: Some( + "/tmp", + ), + hold_on_close: true, + hold_on_start: false, + }, + ), ), - ), - borderless: false, - focus: None, - external_children_index: None, - }, - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: Some( - Command( - RunCommand { - command: "tail", - args: [], - cwd: Some( - "/", - ), - hold_on_close: true, - hold_on_start: false, - }, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: Some( + Command( + RunCommand { + command: "tail", + args: [], + cwd: Some( + "/", + ), + hold_on_close: true, + hold_on_start: false, + }, + ), ), - ), - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + [], + ), ), - floating_panes_template: [], + swap_layouts: [], + swap_tiled_layouts: [], + swap_floating_layouts: [], } diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__global_cwd_and_tab_cwd_prepended_to_panes_with_and_without_cwd.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__global_cwd_and_tab_cwd_prepended_to_panes_with_and_without_cwd.snap index 71b46db4..0c0dc06d 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__global_cwd_and_tab_cwd_prepended_to_panes_with_and_without_cwd.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__global_cwd_and_tab_cwd_prepended_to_panes_with_and_without_cwd.snap @@ -1,17 +1,17 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 1536 +assertion_line: 1701 expression: "format!(\"{:#?}\", layout)" --- Layout { tabs: [ ( None, - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [ - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -24,8 +24,9 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -46,6 +47,7 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, ], split_size: None, @@ -57,22 +59,29 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, [], ), ], focused_tab_index: None, template: Some( - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, + ( + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + [], + ), ), - floating_panes_template: [], + swap_layouts: [], + swap_tiled_layouts: [], + swap_floating_layouts: [], } diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__global_cwd_and_tab_cwd_prepended_to_panes_with_and_without_cwd_in_pane_templates.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__global_cwd_and_tab_cwd_prepended_to_panes_with_and_without_cwd_in_pane_templates.snap index 5c39bbd1..7859311c 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__global_cwd_and_tab_cwd_prepended_to_panes_with_and_without_cwd_in_pane_templates.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__global_cwd_and_tab_cwd_prepended_to_panes_with_and_without_cwd_in_pane_templates.snap @@ -1,21 +1,21 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 1557 +assertion_line: 1722 expression: "format!(\"{:#?}\", layout)" --- Layout { tabs: [ ( None, - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [ - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [ - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -28,8 +28,9 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -50,12 +51,13 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [ - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -68,6 +70,7 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, ], split_size: None, @@ -79,6 +82,7 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, ], split_size: None, @@ -90,6 +94,7 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, ], split_size: None, @@ -101,22 +106,29 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, [], ), ], focused_tab_index: None, template: Some( - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, + ( + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + [], + ), ), - floating_panes_template: [], + swap_layouts: [], + swap_tiled_layouts: [], + swap_floating_layouts: [], } diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__global_cwd_and_tab_cwd_prepended_to_panes_with_and_without_cwd_in_tab_templates.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__global_cwd_and_tab_cwd_prepended_to_panes_with_and_without_cwd_in_tab_templates.snap index 4c6bfd2d..76d08d57 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__global_cwd_and_tab_cwd_prepended_to_panes_with_and_without_cwd_in_tab_templates.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__global_cwd_and_tab_cwd_prepended_to_panes_with_and_without_cwd_in_tab_templates.snap @@ -1,17 +1,17 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 1576 +assertion_line: 1741 expression: "format!(\"{:#?}\", layout)" --- Layout { tabs: [ ( None, - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [ - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -24,8 +24,9 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -46,12 +47,13 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [ - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -64,6 +66,7 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, ], split_size: None, @@ -75,6 +78,7 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, ], split_size: None, @@ -86,22 +90,29 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, [], ), ], focused_tab_index: None, template: Some( - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, + ( + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + [], + ), ), - floating_panes_template: [], + swap_layouts: [], + swap_tiled_layouts: [], + swap_floating_layouts: [], } diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__global_cwd_given_to_panes_without_cwd.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__global_cwd_given_to_panes_without_cwd.snap index 5256565c..c9b824bd 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__global_cwd_given_to_panes_without_cwd.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__global_cwd_given_to_panes_without_cwd.snap @@ -1,59 +1,67 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 1423 +assertion_line: 1588 expression: "format!(\"{:#?}\", layout)" --- Layout { tabs: [], focused_tab_index: None, template: Some( - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [ - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: Some( - Cwd( - "/tmp", + ( + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: Some( + Cwd( + "/tmp", + ), ), - ), - borderless: false, - focus: None, - external_children_index: None, - }, - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: Some( - Command( - RunCommand { - command: "tail", - args: [], - cwd: Some( - "/tmp", - ), - hold_on_close: true, - hold_on_start: false, - }, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: Some( + Command( + RunCommand { + command: "tail", + args: [], + cwd: Some( + "/tmp", + ), + hold_on_close: true, + hold_on_start: false, + }, + ), ), - ), - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + [], + ), ), - floating_panes_template: [], + swap_layouts: [], + swap_tiled_layouts: [], + swap_floating_layouts: [], } diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__global_cwd_passed_from_layout_constructor.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__global_cwd_passed_from_layout_constructor.snap index b0eaf353..328b9bc9 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__global_cwd_passed_from_layout_constructor.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__global_cwd_passed_from_layout_constructor.snap @@ -1,59 +1,67 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 1455 +assertion_line: 1620 expression: "format!(\"{:#?}\", layout)" --- Layout { tabs: [], focused_tab_index: None, template: Some( - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [ - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: Some( - Cwd( - "/tmp", + ( + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: Some( + Cwd( + "/tmp", + ), ), - ), - borderless: false, - focus: None, - external_children_index: None, - }, - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: Some( - Command( - RunCommand { - command: "tail", - args: [], - cwd: Some( - "/tmp", - ), - hold_on_close: true, - hold_on_start: false, - }, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: Some( + Command( + RunCommand { + command: "tail", + args: [], + cwd: Some( + "/tmp", + ), + hold_on_close: true, + hold_on_start: false, + }, + ), ), - ), - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + [], + ), ), - floating_panes_template: [], + swap_layouts: [], + swap_tiled_layouts: [], + swap_floating_layouts: [], } diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__global_cwd_passed_from_layout_constructor_overrides_global_cwd_in_layout_file.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__global_cwd_passed_from_layout_constructor_overrides_global_cwd_in_layout_file.snap index 5aa11997..d16986e1 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__global_cwd_passed_from_layout_constructor_overrides_global_cwd_in_layout_file.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__global_cwd_passed_from_layout_constructor_overrides_global_cwd_in_layout_file.snap @@ -1,59 +1,67 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 1475 +assertion_line: 1640 expression: "format!(\"{:#?}\", layout)" --- Layout { tabs: [], focused_tab_index: None, template: Some( - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [ - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: Some( - Cwd( - "/tmp", + ( + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: Some( + Cwd( + "/tmp", + ), ), - ), - borderless: false, - focus: None, - external_children_index: None, - }, - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: Some( - Command( - RunCommand { - command: "tail", - args: [], - cwd: Some( - "/tmp", - ), - hold_on_close: true, - hold_on_start: false, - }, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: Some( + Command( + RunCommand { + command: "tail", + args: [], + cwd: Some( + "/tmp", + ), + hold_on_close: true, + hold_on_start: false, + }, + ), ), - ), - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + [], + ), ), - floating_panes_template: [], + swap_layouts: [], + swap_tiled_layouts: [], + swap_floating_layouts: [], } diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__global_cwd_prepended_to_panes_with_cwd.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__global_cwd_prepended_to_panes_with_cwd.snap index 8c5d71c1..3b445963 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__global_cwd_prepended_to_panes_with_cwd.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__global_cwd_prepended_to_panes_with_cwd.snap @@ -1,59 +1,67 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 1436 +assertion_line: 1601 expression: "format!(\"{:#?}\", layout)" --- Layout { tabs: [], focused_tab_index: None, template: Some( - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [ - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: Some( - Cwd( - "/tmp/foo", + ( + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: Some( + Cwd( + "/tmp/foo", + ), ), - ), - borderless: false, - focus: None, - external_children_index: None, - }, - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: Some( - Command( - RunCommand { - command: "tail", - args: [], - cwd: Some( - "/home/foo", - ), - hold_on_close: true, - hold_on_start: false, - }, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: Some( + Command( + RunCommand { + command: "tail", + args: [], + cwd: Some( + "/home/foo", + ), + hold_on_close: true, + hold_on_start: false, + }, + ), ), - ), - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + [], + ), ), - floating_panes_template: [], + swap_layouts: [], + swap_tiled_layouts: [], + swap_floating_layouts: [], } diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__global_cwd_with_tab_cwd_given_to_panes_without_cwd.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__global_cwd_with_tab_cwd_given_to_panes_without_cwd.snap index b54634fb..58602c68 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__global_cwd_with_tab_cwd_given_to_panes_without_cwd.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__global_cwd_with_tab_cwd_given_to_panes_without_cwd.snap @@ -1,17 +1,17 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 1491 +assertion_line: 1656 expression: "format!(\"{:#?}\", layout)" --- Layout { tabs: [ ( None, - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [ - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -24,8 +24,9 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -46,6 +47,7 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, ], split_size: None, @@ -57,22 +59,29 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, [], ), ], focused_tab_index: None, template: Some( - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, + ( + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + [], + ), ), - floating_panes_template: [], + swap_layouts: [], + swap_tiled_layouts: [], + swap_floating_layouts: [], } diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__layout_with_command_panes_and_close_on_exit.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__layout_with_command_panes_and_close_on_exit.snap index c16d495e..83f17c11 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__layout_with_command_panes_and_close_on_exit.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__layout_with_command_panes_and_close_on_exit.snap @@ -1,43 +1,50 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 283 +assertion_line: 448 expression: "format!(\"{:#?}\", layout)" --- Layout { tabs: [], focused_tab_index: None, template: Some( - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [ - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: Some( - Command( - RunCommand { - command: "htop", - args: [], - cwd: None, - hold_on_close: false, - hold_on_start: false, - }, + ( + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: Some( + Command( + RunCommand { + command: "htop", + args: [], + cwd: None, + hold_on_close: false, + hold_on_start: false, + }, + ), ), - ), - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + [], + ), ), - floating_panes_template: [], + swap_layouts: [], + swap_tiled_layouts: [], + swap_floating_layouts: [], } diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__layout_with_command_panes_and_start_suspended.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__layout_with_command_panes_and_start_suspended.snap index 6723bc21..8b3afcdd 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__layout_with_command_panes_and_start_suspended.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__layout_with_command_panes_and_start_suspended.snap @@ -1,43 +1,50 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 296 +assertion_line: 461 expression: "format!(\"{:#?}\", layout)" --- Layout { tabs: [], focused_tab_index: None, template: Some( - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [ - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: Some( - Command( - RunCommand { - command: "htop", - args: [], - cwd: None, - hold_on_close: true, - hold_on_start: true, - }, + ( + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: Some( + Command( + RunCommand { + command: "htop", + args: [], + cwd: None, + hold_on_close: true, + hold_on_start: true, + }, + ), ), - ), - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + [], + ), ), - floating_panes_template: [], + swap_layouts: [], + swap_tiled_layouts: [], + swap_floating_layouts: [], } diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__layout_with_default_tab_template.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__layout_with_default_tab_template.snap index 8065fc4d..daf284ff 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__layout_with_default_tab_template.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__layout_with_default_tab_template.snap @@ -1,6 +1,6 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 555 +assertion_line: 720 expression: "format!(\"{:#?}\", layout)" --- Layout { @@ -9,11 +9,11 @@ Layout { Some( "my first tab", ), - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [ - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -22,12 +22,13 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, - PaneLayout { + TiledPaneLayout { children_split_direction: Vertical, name: None, children: [ - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -36,8 +37,9 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -46,6 +48,7 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, ], split_size: None, @@ -53,8 +56,9 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -63,6 +67,7 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, ], split_size: None, @@ -70,6 +75,7 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, [], ), @@ -77,11 +83,11 @@ Layout { Some( "my second tab", ), - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [ - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -90,12 +96,13 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [ - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -104,8 +111,9 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -114,6 +122,7 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, ], split_size: None, @@ -121,8 +130,9 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -131,6 +141,7 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, ], split_size: None, @@ -138,16 +149,17 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, [], ), ( None, - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [ - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -156,8 +168,9 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -166,8 +179,9 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -176,6 +190,7 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, ], split_size: None, @@ -183,53 +198,63 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, [], ), ], focused_tab_index: None, template: Some( - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [ - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, + ( + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + [], + ), ), - floating_panes_template: [], + swap_layouts: [], + swap_tiled_layouts: [], + swap_floating_layouts: [], } diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__layout_with_nested_branched_pane_templates.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__layout_with_nested_branched_pane_templates.snap index 687d7618..cb166970 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__layout_with_nested_branched_pane_templates.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__layout_with_nested_branched_pane_templates.snap @@ -1,126 +1,142 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 650 +assertion_line: 815 expression: "format!(\"{:#?}\", layout)" --- Layout { tabs: [], focused_tab_index: None, template: Some( - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [ - PaneLayout { - children_split_direction: Vertical, - name: None, - children: [ - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [ - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [ - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, + ( + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Vertical, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + [], + ), ), - floating_panes_template: [], + swap_layouts: [], + swap_tiled_layouts: [], + swap_floating_layouts: [], } diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__layout_with_nested_pane_templates.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__layout_with_nested_pane_templates.snap index e5a655f7..3fab5306 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__layout_with_nested_pane_templates.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__layout_with_nested_pane_templates.snap @@ -1,95 +1,108 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 624 +assertion_line: 789 expression: "format!(\"{:#?}\", layout)" --- Layout { tabs: [], focused_tab_index: None, template: Some( - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [ - PaneLayout { - children_split_direction: Vertical, - name: None, - children: [ - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [ - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, + ( + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Vertical, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + [], + ), ), - floating_panes_template: [], + swap_layouts: [], + swap_tiled_layouts: [], + swap_floating_layouts: [], } diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__layout_with_pane_templates.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__layout_with_pane_templates.snap index cbbddf74..f52d2c97 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__layout_with_pane_templates.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__layout_with_pane_templates.snap @@ -1,240 +1,267 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 582 +assertion_line: 747 expression: "format!(\"{:#?}\", layout)" --- Layout { tabs: [], focused_tab_index: None, template: Some( - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [ - PaneLayout { - children_split_direction: Vertical, - name: None, - children: [ - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [ - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - PaneLayout { - children_split_direction: Vertical, - name: None, - children: [ - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [ - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - PaneLayout { - children_split_direction: Vertical, - name: None, - children: [ - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - PaneLayout { - children_split_direction: Vertical, - name: None, - children: [ - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - PaneLayout { - children_split_direction: Vertical, - name: None, - children: [ - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, + ( + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Vertical, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Vertical, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Vertical, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Vertical, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Vertical, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + [], + ), ), - floating_panes_template: [], + swap_layouts: [], + swap_tiled_layouts: [], + swap_floating_layouts: [], } diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__layout_with_tab_and_pane_templates.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__layout_with_tab_and_pane_templates.snap index 464c1647..9126477e 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__layout_with_tab_and_pane_templates.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__layout_with_tab_and_pane_templates.snap @@ -1,21 +1,21 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 603 +assertion_line: 768 expression: "format!(\"{:#?}\", layout)" --- Layout { tabs: [ ( None, - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [ - PaneLayout { + TiledPaneLayout { children_split_direction: Vertical, name: None, children: [ - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -24,12 +24,13 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [ - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -48,6 +49,7 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, ], split_size: None, @@ -55,8 +57,9 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -65,6 +68,7 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, ], split_size: None, @@ -72,6 +76,7 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, ], split_size: None, @@ -79,22 +84,29 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, [], ), ], focused_tab_index: None, template: Some( - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, + ( + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + [], + ), ), - floating_panes_template: [], + swap_layouts: [], + swap_tiled_layouts: [], + swap_floating_layouts: [], } diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__layout_with_tabs_and_floating_panes.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__layout_with_tabs_and_floating_panes.snap index 5cdf517a..61286160 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__layout_with_tabs_and_floating_panes.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__layout_with_tabs_and_floating_panes.snap @@ -1,17 +1,17 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 263 +assertion_line: 254 expression: "format!(\"{:#?}\", layout)" --- Layout { tabs: [ ( None, - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [ - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -20,6 +20,7 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, ], split_size: None, @@ -27,9 +28,10 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, [ - FloatingPanesLayout { + FloatingPaneLayout { name: None, height: None, width: None, @@ -42,11 +44,11 @@ Layout { ), ( None, - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [ - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -55,6 +57,7 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, ], split_size: None, @@ -62,9 +65,10 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, [ - FloatingPanesLayout { + FloatingPaneLayout { name: None, height: None, width: None, @@ -73,7 +77,7 @@ Layout { run: None, focus: None, }, - FloatingPanesLayout { + FloatingPaneLayout { name: None, height: None, width: None, @@ -87,16 +91,22 @@ Layout { ], focused_tab_index: None, template: Some( - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, + ( + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + [], + ), ), - floating_panes_template: [], + swap_layouts: [], + swap_tiled_layouts: [], + swap_floating_layouts: [], } diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__pane_template_command_with_cwd_is_overriden_by_its_consumers_bare_cwd.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__pane_template_command_with_cwd_is_overriden_by_its_consumers_bare_cwd.snap index 4f4552ee..a3a4965c 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__pane_template_command_with_cwd_is_overriden_by_its_consumers_bare_cwd.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__pane_template_command_with_cwd_is_overriden_by_its_consumers_bare_cwd.snap @@ -1,45 +1,52 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 1307 +assertion_line: 1472 expression: "format!(\"{:#?}\", layout)" --- Layout { tabs: [], focused_tab_index: None, template: Some( - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [ - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: Some( - Command( - RunCommand { - command: "tail", - args: [], - cwd: Some( - "/tmp/bar", - ), - hold_on_close: true, - hold_on_start: false, - }, + ( + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: Some( + Command( + RunCommand { + command: "tail", + args: [], + cwd: Some( + "/tmp/bar", + ), + hold_on_close: true, + hold_on_start: false, + }, + ), ), - ), - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + [], + ), ), - floating_panes_template: [], + swap_layouts: [], + swap_tiled_layouts: [], + swap_floating_layouts: [], } diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__pane_template_command_with_cwd_overriden_by_its_consumers_command_cwd.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__pane_template_command_with_cwd_overriden_by_its_consumers_command_cwd.snap index fc5523fa..a0d1a943 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__pane_template_command_with_cwd_overriden_by_its_consumers_command_cwd.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__pane_template_command_with_cwd_overriden_by_its_consumers_command_cwd.snap @@ -1,45 +1,52 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 1253 +assertion_line: 1418 expression: "format!(\"{:#?}\", layout)" --- Layout { tabs: [], focused_tab_index: None, template: Some( - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [ - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: Some( - Command( - RunCommand { - command: "pwd", - args: [], - cwd: Some( - "/tmp/foo", - ), - hold_on_close: true, - hold_on_start: false, - }, + ( + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: Some( + Command( + RunCommand { + command: "pwd", + args: [], + cwd: Some( + "/tmp/foo", + ), + hold_on_close: true, + hold_on_start: false, + }, + ), ), - ), - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + [], + ), ), - floating_panes_template: [], + swap_layouts: [], + swap_tiled_layouts: [], + swap_floating_layouts: [], } diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__pane_template_command_with_cwd_remains_when_its_consumer_command_does_not_have_a_cwd.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__pane_template_command_with_cwd_remains_when_its_consumer_command_does_not_have_a_cwd.snap index 3c00d46f..81f0a09f 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__pane_template_command_with_cwd_remains_when_its_consumer_command_does_not_have_a_cwd.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__pane_template_command_with_cwd_remains_when_its_consumer_command_does_not_have_a_cwd.snap @@ -1,45 +1,52 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 1270 +assertion_line: 1435 expression: "format!(\"{:#?}\", layout)" --- Layout { tabs: [], focused_tab_index: None, template: Some( - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [ - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: Some( - Command( - RunCommand { - command: "pwd", - args: [], - cwd: Some( - "/tmp/bar", - ), - hold_on_close: true, - hold_on_start: false, - }, + ( + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: Some( + Command( + RunCommand { + command: "pwd", + args: [], + cwd: Some( + "/tmp/bar", + ), + hold_on_close: true, + hold_on_start: false, + }, + ), ), - ), - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + [], + ), ), - floating_panes_template: [], + swap_layouts: [], + swap_tiled_layouts: [], + swap_floating_layouts: [], } diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__pane_template_command_without_cwd_is_overriden_by_its_consumers_cwd.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__pane_template_command_without_cwd_is_overriden_by_its_consumers_cwd.snap index b88f2a9e..ddcd1225 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__pane_template_command_without_cwd_is_overriden_by_its_consumers_cwd.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__pane_template_command_without_cwd_is_overriden_by_its_consumers_cwd.snap @@ -1,45 +1,52 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 1288 +assertion_line: 1453 expression: "format!(\"{:#?}\", layout)" --- Layout { tabs: [], focused_tab_index: None, template: Some( - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [ - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: Some( - Command( - RunCommand { - command: "pwd", - args: [], - cwd: Some( - "/tmp/bar", - ), - hold_on_close: true, - hold_on_start: false, - }, + ( + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: Some( + Command( + RunCommand { + command: "pwd", + args: [], + cwd: Some( + "/tmp/bar", + ), + hold_on_close: true, + hold_on_start: false, + }, + ), ), - ), - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + [], + ), ), - floating_panes_template: [], + swap_layouts: [], + swap_tiled_layouts: [], + swap_floating_layouts: [], } diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__pane_template_command_without_cwd_receives_its_consumers_bare_cwd.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__pane_template_command_without_cwd_receives_its_consumers_bare_cwd.snap index 3d561463..74318d3a 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__pane_template_command_without_cwd_receives_its_consumers_bare_cwd.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__pane_template_command_without_cwd_receives_its_consumers_bare_cwd.snap @@ -1,45 +1,52 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 1325 +assertion_line: 1490 expression: "format!(\"{:#?}\", layout)" --- Layout { tabs: [], focused_tab_index: None, template: Some( - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [ - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: Some( - Command( - RunCommand { - command: "tail", - args: [], - cwd: Some( - "/tmp/bar", - ), - hold_on_close: true, - hold_on_start: false, - }, + ( + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: Some( + Command( + RunCommand { + command: "tail", + args: [], + cwd: Some( + "/tmp/bar", + ), + hold_on_close: true, + hold_on_start: false, + }, + ), ), - ), - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + [], + ), ), - floating_panes_template: [], + swap_layouts: [], + swap_tiled_layouts: [], + swap_floating_layouts: [], } diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__pane_template_with_bare_cwd_overriden_by_its_consumers_bare_cwd.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__pane_template_with_bare_cwd_overriden_by_its_consumers_bare_cwd.snap index 89332ea3..13492fea 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__pane_template_with_bare_cwd_overriden_by_its_consumers_bare_cwd.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__pane_template_with_bare_cwd_overriden_by_its_consumers_bare_cwd.snap @@ -1,37 +1,44 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 1343 +assertion_line: 1508 expression: "format!(\"{:#?}\", layout)" --- Layout { tabs: [], focused_tab_index: None, template: Some( - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [ - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: Some( - Cwd( - "/tmp/bar", + ( + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: Some( + Cwd( + "/tmp/bar", + ), ), - ), - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + [], + ), ), - floating_panes_template: [], + swap_layouts: [], + swap_tiled_layouts: [], + swap_floating_layouts: [], } diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__pane_template_with_bare_propagated_to_its_consumer_command_with_cwd.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__pane_template_with_bare_propagated_to_its_consumer_command_with_cwd.snap index 3797afc5..bb193e7c 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__pane_template_with_bare_propagated_to_its_consumer_command_with_cwd.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__pane_template_with_bare_propagated_to_its_consumer_command_with_cwd.snap @@ -1,45 +1,52 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 1377 +assertion_line: 1542 expression: "format!(\"{:#?}\", layout)" --- Layout { tabs: [], focused_tab_index: None, template: Some( - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [ - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: Some( - Command( - RunCommand { - command: "tail", - args: [], - cwd: Some( - "/tmp/bar", - ), - hold_on_close: true, - hold_on_start: false, - }, + ( + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: Some( + Command( + RunCommand { + command: "tail", + args: [], + cwd: Some( + "/tmp/bar", + ), + hold_on_close: true, + hold_on_start: false, + }, + ), ), - ), - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + [], + ), ), - floating_panes_template: [], + swap_layouts: [], + swap_tiled_layouts: [], + swap_floating_layouts: [], } diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__pane_template_with_bare_propagated_to_its_consumer_command_without_cwd.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__pane_template_with_bare_propagated_to_its_consumer_command_without_cwd.snap index 072d0bc5..d28a7be1 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__pane_template_with_bare_propagated_to_its_consumer_command_without_cwd.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__pane_template_with_bare_propagated_to_its_consumer_command_without_cwd.snap @@ -1,45 +1,52 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 1359 +assertion_line: 1524 expression: "format!(\"{:#?}\", layout)" --- Layout { tabs: [], focused_tab_index: None, template: Some( - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [ - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: Some( - Command( - RunCommand { - command: "tail", - args: [], - cwd: Some( - "/tmp/foo", - ), - hold_on_close: true, - hold_on_start: false, - }, + ( + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: Some( + Command( + RunCommand { + command: "tail", + args: [], + cwd: Some( + "/tmp/foo", + ), + hold_on_close: true, + hold_on_start: false, + }, + ), ), - ), - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + [], + ), ), - floating_panes_template: [], + swap_layouts: [], + swap_tiled_layouts: [], + swap_floating_layouts: [], } diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__pane_template_with_bare_propagated_to_its_consumer_edit.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__pane_template_with_bare_propagated_to_its_consumer_edit.snap index a6aac1f1..34d0fb32 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__pane_template_with_bare_propagated_to_its_consumer_edit.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__pane_template_with_bare_propagated_to_its_consumer_edit.snap @@ -1,38 +1,45 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 1393 +assertion_line: 1558 expression: "format!(\"{:#?}\", layout)" --- Layout { tabs: [], focused_tab_index: None, template: Some( - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [ - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: Some( - EditFile( - "/tmp/foo/bar", - None, + ( + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: Some( + EditFile( + "/tmp/foo/bar", + None, + ), ), - ), - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + [], + ), ), - floating_panes_template: [], + swap_layouts: [], + swap_tiled_layouts: [], + swap_floating_layouts: [], } diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__pane_template_with_command_propagated_to_its_consumer_edit.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__pane_template_with_command_propagated_to_its_consumer_edit.snap index e77e7b95..298be4e0 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__pane_template_with_command_propagated_to_its_consumer_edit.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__pane_template_with_command_propagated_to_its_consumer_edit.snap @@ -1,38 +1,45 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 1409 +assertion_line: 1574 expression: "format!(\"{:#?}\", layout)" --- Layout { tabs: [], focused_tab_index: None, template: Some( - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [ - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: Some( - EditFile( - "/tmp/foo/bar", - None, + ( + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [ + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: Some( + EditFile( + "/tmp/foo/bar", + None, + ), ), - ), - borderless: false, - focus: None, - external_children_index: None, - }, - ], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + ], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + [], + ), ), - floating_panes_template: [], + swap_layouts: [], + swap_tiled_layouts: [], + swap_floating_layouts: [], } diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__tab_cwd_given_to_panes_without_cwd.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__tab_cwd_given_to_panes_without_cwd.snap index 004238aa..718b0edb 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__tab_cwd_given_to_panes_without_cwd.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__tab_cwd_given_to_panes_without_cwd.snap @@ -1,17 +1,17 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 1506 +assertion_line: 1671 expression: "format!(\"{:#?}\", layout)" --- Layout { tabs: [ ( None, - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [ - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -24,8 +24,9 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -46,6 +47,7 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, ], split_size: None, @@ -57,22 +59,29 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, [], ), ], focused_tab_index: None, template: Some( - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, + ( + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + [], + ), ), - floating_panes_template: [], + swap_layouts: [], + swap_tiled_layouts: [], + swap_floating_layouts: [], } diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__tab_cwd_prepended_to_panes_with_cwd.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__tab_cwd_prepended_to_panes_with_cwd.snap index 573e0465..1a205760 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__tab_cwd_prepended_to_panes_with_cwd.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__tab_cwd_prepended_to_panes_with_cwd.snap @@ -1,17 +1,17 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 1521 +assertion_line: 1686 expression: "format!(\"{:#?}\", layout)" --- Layout { tabs: [ ( None, - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [ - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -24,8 +24,9 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, - PaneLayout { + TiledPaneLayout { children_split_direction: Horizontal, name: None, children: [], @@ -46,6 +47,7 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, ], split_size: None, @@ -57,22 +59,29 @@ Layout { borderless: false, focus: None, external_children_index: None, + children_are_stacked: false, }, [], ), ], focused_tab_index: None, template: Some( - PaneLayout { - children_split_direction: Horizontal, - name: None, - children: [], - split_size: None, - run: None, - borderless: false, - focus: None, - external_children_index: None, - }, + ( + TiledPaneLayout { + children_split_direction: Horizontal, + name: None, + children: [], + split_size: None, + run: None, + borderless: false, + focus: None, + external_children_index: None, + children_are_stacked: false, + }, + [], + ), ), - floating_panes_template: [], + swap_layouts: [], + swap_tiled_layouts: [], + swap_floating_layouts: [], } |
