diff options
author | Theo Salzmann <dev@on3iro.de> | 2023-04-18 16:33:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-18 16:33:20 +0200 |
commit | 525928b18a05d8662b5de7e85987428d84c0cb7d (patch) | |
tree | 03654c4d59cc6c1902ac90f3b497f2892c58f749 /zellij-utils | |
parent | c7bd2ce9222d328369216ba287c57752910e0e88 (diff) |
feat: Add layout configuration to exclude panes from tab sync (#2314)
Diffstat (limited to 'zellij-utils')
48 files changed, 394 insertions, 5 deletions
diff --git a/zellij-utils/src/input/layout.rs b/zellij-utils/src/input/layout.rs index a07e1d313..830f7c028 100644 --- a/zellij-utils/src/input/layout.rs +++ b/zellij-utils/src/input/layout.rs @@ -395,6 +395,7 @@ pub struct TiledPaneLayout { pub external_children_index: Option<usize>, pub children_are_stacked: bool, pub is_expanded_in_stack: bool, + pub exclude_from_sync: Option<bool>, } impl TiledPaneLayout { diff --git a/zellij-utils/src/input/unit/layout_test.rs b/zellij-utils/src/input/unit/layout_test.rs index 7ff2567a9..a38abe028 100644 --- a/zellij-utils/src/input/unit/layout_test.rs +++ b/zellij-utils/src/input/unit/layout_test.rs @@ -1009,6 +1009,17 @@ fn combined_tab_and_pane_template_both_with_children() { } #[test] +fn layout_with_pane_excluded_from_sync() { + let kdl_layout = r#" + layout { + pane exclude_from_sync=true + } + "#; + let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); + assert_snapshot!(format!("{:#?}", layout)); +} + +#[test] fn cannot_define_tab_template_name_with_space() { let kdl_layout = r#" 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 65450c122..d01949514 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 @@ -33,6 +33,7 @@ Layout { external_children_index: None, children_are_stacked: false, is_expanded_in_stack: false, + exclude_from_sync: None, }, TiledPaneLayout { children_split_direction: Horizontal, @@ -58,6 +59,7 @@ Layout { external_children_index: None, children_are_stacked: false, is_expanded_in_stack: false, + exclude_from_sync: None, }, ], split_size: None, @@ -67,6 +69,7 @@ Layout { external_children_index: None, children_are_stacked: false, is_expanded_in_stack: false, + exclude_from_sync: None, }, [], ), 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 5db6198b3..d31f721f0 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 @@ -36,6 +36,7 @@ Layout { external_children_index: None, children_are_stacked: false, is_expanded_in_stack: false, + exclude_from_sync: None, }, TiledPaneLayout { children_split_direction: Horizontal, @@ -61,6 +62,7 @@ Layout { external_children_index: None, children_are_stacked: false, is_expanded_in_stack: false, + exclude_from_sync: None, }, ], split_size: None, @@ -70,6 +72,7 @@ Layout { external_children_index: None, children_are_stacked: false, is_expanded_in_stack: false, + exclude_from_sync: None, }, [], ), diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__can_define_a_stack_with_an_expanded_pane.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__can_define_a_stack_with_an_expanded_pane.snap index 92e0e4365..31ea7cb7d 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__can_define_a_stack_with_an_expanded_pane.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__can_define_a_stack_with_an_expanded_pane.snap @@ -1,6 +1,5 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 1896 expression: "format!(\"{:#?}\", layout)" --- Layout { @@ -27,6 +26,7 @@ Layout { external_children_index: None, children_are_stacked: false, is_expanded_in_stack: false, + exclude_from_sync: None, }, TiledPaneLayout { children_split_direction: Horizontal, @@ -39,6 +39,7 @@ Layout { external_children_index: None, children_are_stacked: false, is_expanded_in_stack: true, + exclude_from_sync: None, }, TiledPaneLayout { children_split_direction: Horizontal, @@ -51,6 +52,7 @@ Layout { external_children_index: None, children_are_stacked: false, is_expanded_in_stack: false, + exclude_from_sync: None, }, ], split_size: None, @@ -60,6 +62,7 @@ Layout { external_children_index: None, children_are_stacked: true, is_expanded_in_stack: false, + exclude_from_sync: None, }, ], split_size: None, @@ -69,6 +72,7 @@ Layout { external_children_index: None, children_are_stacked: false, is_expanded_in_stack: false, + exclude_from_sync: None, }, [], ), diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__can_define_stacked_children_for_pane_node.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__can_define_stacked_children_for_pane_node.snap index c9aa7f872..85fa560d4 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__can_define_stacked_children_for_pane_node.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__can_define_stacked_children_for_pane_node.snap @@ -27,6 +27,7 @@ Layout { external_children_index: None, children_are_stacked: false, is_expanded_in_stack: false, + exclude_from_sync: None, }, TiledPaneLayout { children_split_direction: Horizontal, @@ -39,6 +40,7 @@ Layout { external_children_index: None, children_are_stacked: false, is_expanded_in_stack: false, + exclude_from_sync: None, }, ], split_size: None, @@ -48,6 +50,7 @@ Layout { external_children_index: None, children_are_stacked: true, is_expanded_in_stack: false, + exclude_from_sync: None, }, ], split_size: None, @@ -57,6 +60,7 @@ Layout { external_children_index: None, children_are_stacked: false, is_expanded_in_stack: false, + exclude_from_sync: None, }, [], ), diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__can_define_stacked_children_for_pane_template.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__can_define_stacked_children_for_pane_template.snap index 36186c3c1..2a6a8b2cf 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__can_define_stacked_children_for_pane_template.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__can_define_stacked_children_for_pane_template.snap @@ -31,6 +31,7 @@ Layout { external_children_index: None, children_are_stacked: false, is_expanded_in_stack: false, + exclude_from_sync: None, }, TiledPaneLayout { |