aboutsummaryrefslogtreecommitdiffstats
path: root/sl0ppij/zellij-utils/src/plugin_api
diff options
context:
space:
mode:
authoruser <user@clank>2026-08-08 21:06:40 +0200
committeruser <user@clank>2026-08-12 19:34:19 +0200
commit0ba57cf6e9bfec08c198fc8eb5fa219b0c8c96ba (patch)
tree28bcfea151d04f0fa7a8294f802df686c6f845e7 /sl0ppij/zellij-utils/src/plugin_api
parentsl0p: uniform pane gap + aspect-corrected horizontal gap (diff)
downloadsl0ppi-0ba57cf6e9bfec08c198fc8eb5fa219b0c8c96ba.tar.gz
sl0ppi-0ba57cf6e9bfec08c198fc8eb5fa219b0c8c96ba.tar.xz
sl0ppi-0ba57cf6e9bfec08c198fc8eb5fa219b0c8c96ba.zip
sl0p: CSS-style 1/2/4-value shorthand for inner padding
`padding` now accepts: padding 1 -> all four sides padding 1 2 -> up/down = 1, left/right = 2 padding 1 2 3 4 -> up=1 down=2 left=3 right=4 NOTE the 4-value order is UP DOWN LEFT RIGHT as requested, deliberately NOT CSS's clockwise top-right-bottom-left. Documented on PanePadding and at the parser, since the similarity to CSS invites the wrong assumption. 3 or 5 values are rejected with a message naming the accepted forms, rather than being silently reinterpreted. Negative values clamp to 0. ASPECT: only the 1-value form is aspect-corrected (left/right multiplied by gap_aspect) so `padding 1` looks square on a non-square cell grid. The 2- and 4-value forms are literal: specifying axes separately means the caller is already controlling horizontal size, and silently doubling it would surprise. Style now carries a PanePadding {top,bottom,left,right} instead of an x/y pair, which also collapses the reconfigure plumbing back to a single field rather than growing another parameter per side. to_kdl always emits the explicit 4-value form: emitting the 1-value form would re-apply gap_aspect on the next read and silently double the padding on every config round-trip. Baselines held: zellij-utils 435/5, zellij-server 1421/30.
Diffstat (limited to 'sl0ppij/zellij-utils/src/plugin_api')
-rw-r--r--sl0ppij/zellij-utils/src/plugin_api/event.rs3
-rw-r--r--sl0ppij/zellij-utils/src/plugin_api/style.rs3
2 files changed, 2 insertions, 4 deletions
diff --git a/sl0ppij/zellij-utils/src/plugin_api/event.rs b/sl0ppij/zellij-utils/src/plugin_api/event.rs
index 87af043..7bb1c7a 100644
--- a/sl0ppij/zellij-utils/src/plugin_api/event.rs
+++ b/sl0ppij/zellij-utils/src/plugin_api/event.rs
@@ -2495,8 +2495,7 @@ fn serialize_mode_update_event_with_non_default_values() {
pane_title_alignment: Default::default(),
pane_gap_x: Default::default(),
pane_gap_y: Default::default(),
- pane_padding_x: Default::default(),
- pane_padding_y: Default::default(),
+ pane_padding: Default::default(),
},
capabilities: PluginCapabilities { arrow_fonts: false },
session_name: Some("my awesome test session".to_owned()),
diff --git a/sl0ppij/zellij-utils/src/plugin_api/style.rs b/sl0ppij/zellij-utils/src/plugin_api/style.rs
index 266ab7f..527f984 100644
--- a/sl0ppij/zellij-utils/src/plugin_api/style.rs
+++ b/sl0ppij/zellij-utils/src/plugin_api/style.rs
@@ -28,8 +28,7 @@ impl TryFrom<ProtobufStyle> for Style {
pane_title_alignment: Default::default(),
pane_gap_x: Default::default(),
pane_gap_y: Default::default(),
- pane_padding_x: Default::default(),
- pane_padding_y: Default::default(),
+ pane_padding: Default::default(),
})
}
}