diff options
| author | Aram Drevekenin <aram@poor.dev> | 2026-07-04 16:27:08 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-04 16:27:08 +0200 |
| commit | 82c4a24d701ecf9a48aa01bcc5c0bb3882747fe7 (patch) | |
| tree | 906e2f207dc1f5bf01112d7889663a2ce0a4cf2f /zellij-utils/src/kdl/mod.rs | |
| parent | Reduce compilation time (#5321) (diff) | |
| download | sl0ppij-82c4a24d701ecf9a48aa01bcc5c0bb3882747fe7.tar.gz sl0ppij-82c4a24d701ecf9a48aa01bcc5c0bb3882747fe7.tar.xz sl0ppij-82c4a24d701ecf9a48aa01bcc5c0bb3882747fe7.zip | |
Stacked lists (#5331)
* initial implementation
* improve ui
* fix: stacked resize interaction
* title list boundaries fix
* fix BEL
* mouse parity
* float/embed + bulk-op features
* fix in-place bug
* improve ui
* config live reload
* improve ui
* fix issues, add exit status
* fix for serialization
* fix tests
* integration tests
* comments
* refactor: duplicate title logic
* refactor: consolidate logic
* fix: flaky tests
* add a stacked swap layout
* rustfmt
* fix e2e
* add pr
Diffstat (limited to 'zellij-utils/src/kdl/mod.rs')
| -rw-r--r-- | zellij-utils/src/kdl/mod.rs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/zellij-utils/src/kdl/mod.rs b/zellij-utils/src/kdl/mod.rs index 42ce65c5..30495d5f 100644 --- a/zellij-utils/src/kdl/mod.rs +++ b/zellij-utils/src/kdl/mod.rs @@ -2809,6 +2809,9 @@ impl Options { }; let stacked_resize = kdl_property_first_arg_as_bool_or_error!(kdl_options, "stacked_resize").map(|(v, _)| v); + let stacked_pane_list = + kdl_property_first_arg_as_bool_or_error!(kdl_options, "stacked_pane_list") + .map(|(v, _)| v); let show_startup_tips = kdl_property_first_arg_as_bool_or_error!(kdl_options, "show_startup_tips") .map(|(v, _)| v); @@ -2938,6 +2941,7 @@ impl Options { web_server, web_sharing, stacked_resize, + stacked_pane_list, show_startup_tips, show_release_notes, advanced_mouse_actions, @@ -4069,6 +4073,34 @@ impl Options { None } } + fn stacked_pane_list_to_kdl(&self, add_comments: bool) -> Option<KdlNode> { + let comment_text = format!( + "{}\n{}\n{}\n{}", + " ", + "// Whether stacked panes display as a list with the expanded pane pinned to the bottom", + "// Default: true", + "// ", + ); + + let create_node = |node_value: bool| -> KdlNode { + let mut node = KdlNode::new("stacked_pane_list"); + node.push(KdlValue::Bool(node_value)); + node + }; + if let Some(stacked_pane_list) = self.stacked_pane_list { + let mut node = create_node(stacked_pane_list); + if add_comments { + node.set_leading(format!("{}\n", comment_text)); + } + Some(node) + } else if add_comments { + let mut node = create_node(false); + node.set_leading(format!("{}\n// ", comment_text)); + Some(node) + } else { + None + } + } fn show_startup_tips_to_kdl(&self, add_comments: bool) -> Option<KdlNode> { let comment_text = format!( "{}\n{}\n{}\n{}", @@ -4571,6 +4603,9 @@ impl Options { if let Some(stacked_resize) = self.stacked_resize_to_kdl(add_comments) { nodes.push(stacked_resize); } + if let Some(stacked_pane_list) = self.stacked_pane_list_to_kdl(add_comments) { + nodes.push(stacked_pane_list); + } if let Some(show_startup_tips) = self.show_startup_tips_to_kdl(add_comments) { nodes.push(show_startup_tips); } |
