diff options
| author | Aram Drevekenin <aram@poor.dev> | 2026-03-30 20:34:12 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-30 20:34:12 +0200 |
| commit | 22ace8e54fbdadd08973854ae7178535a62065b1 (patch) | |
| tree | 0793eae0b4f0ae379b8cc73fda16ac4b3676e43d /zellij-utils/src/kdl | |
| parent | Error on socket paths that are too long (#4957) (diff) | |
| download | sl0ppij-22ace8e54fbdadd08973854ae7178535a62065b1.tar.gz sl0ppij-22ace8e54fbdadd08973854ae7178535a62065b1.tar.xz sl0ppij-22ace8e54fbdadd08973854ae7178535a62065b1.zip | |
Proper error when providing layout name with a tab (#4958)
* proper error when providing layout name with a tab
* rustfmt
Diffstat (limited to 'zellij-utils/src/kdl')
| -rw-r--r-- | zellij-utils/src/kdl/kdl_layout_parser.rs | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/zellij-utils/src/kdl/kdl_layout_parser.rs b/zellij-utils/src/kdl/kdl_layout_parser.rs index ff7fcfe3..579a4b14 100644 --- a/zellij-utils/src/kdl/kdl_layout_parser.rs +++ b/zellij-utils/src/kdl/kdl_layout_parser.rs @@ -2505,9 +2505,23 @@ impl<'a> KdlLayoutParser<'a> { let layout_has_hide_floating = kdl_get_bool_property_or_child_value!(layout_node, "hide_floating_panes").is_some(); - if layout_has_tab_name || layout_has_split_direction || layout_has_hide_floating { + if layout_has_tab_name { return Err(ConfigError::new_layout_kdl_error( - "Tab properties on the layout node can only be used when there are no explicit tab nodes".into(), + "The 'name' property on the layout node is treated as a tab name and cannot be used when there are explicit tab nodes. To name individual tabs, use: tab name=\"my-tab\" { ... }".into(), + layout_node.span().offset(), + layout_node.span().len(), + )); + } + if layout_has_split_direction { + return Err(ConfigError::new_layout_kdl_error( + "The 'split_direction' property on the layout node is treated as a tab property and cannot be used when there are explicit tab nodes. To set split direction, place it on individual tab nodes: tab split_direction=\"vertical\" { ... }".into(), + layout_node.span().offset(), + layout_node.span().len(), + )); + } + if layout_has_hide_floating { + return Err(ConfigError::new_layout_kdl_error( + "The 'hide_floating_panes' property on the layout node is treated as a tab property and cannot be used when there are explicit tab nodes. To hide floating panes, place it on individual tab nodes: tab hide_floating_panes=true { ... }".into(), layout_node.span().offset(), layout_node.span().len(), )); |
