diff options
| author | user <user@clank> | 2026-08-08 19:31:55 +0200 |
|---|---|---|
| committer | user <user@clank> | 2026-08-08 19:31:55 +0200 |
| commit | 3f767ee91b08eebf10b693c08c173b8329ba2c14 (patch) | |
| tree | 6f2b7feed0f454f8a6036fbef54b2d647f35462d /zellij-utils/src/plugin_api | |
| parent | sl0p: rebuilt default plugin wasm assets (diff) | |
| download | sl0ppij-3f767ee91b08eebf10b693c08c173b8329ba2c14.tar.gz sl0ppij-3f767ee91b08eebf10b693c08c173b8329ba2c14.tar.xz sl0ppij-3f767ee91b08eebf10b693c08c173b8329ba2c14.zip | |
sl0p: configurable pane title alignment
Adds `ui { pane_frames { title_alignment "left"|"center"|"right" } }`.
Full-frame panes previously hardcoded the title flush left, while frameless
panes (pane_frame_style "titles") already centered it via
compose_bracketed_title. This brings full frames up to parity and makes the
position configurable.
Implementation notes:
- The value rides on `Style`, which is already threaded to FrameParams, so no
new plumbing through Tab/PaneContentsAndUi was needed.
- It is deliberately NOT round-tripped over the plugin protobuf boundary:
plugins have no use for frame title alignment and adding a proto field
would force regenerating the committed prost assets in assets/prost/.
- Left keeps the original code path untouched, so default configs render
exactly as before.
- The geometry loop clamps the title start against the right-side indicators
and breaks on `>=` rather than `==`, so a mis-clamped segment cannot spin.
Tests: alignment ordering, frame width preservation across widths, and
narrow-pane safety (cols 1..24 must not panic or corrupt width).
Diffstat (limited to 'zellij-utils/src/plugin_api')
| -rw-r--r-- | zellij-utils/src/plugin_api/event.rs | 1 | ||||
| -rw-r--r-- | zellij-utils/src/plugin_api/style.rs | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/zellij-utils/src/plugin_api/event.rs b/zellij-utils/src/plugin_api/event.rs index 970f5e2c..0189d11b 100644 --- a/zellij-utils/src/plugin_api/event.rs +++ b/zellij-utils/src/plugin_api/event.rs @@ -2492,6 +2492,7 @@ fn serialize_mode_update_event_with_non_default_values() { // TODO: replace default rounded_corners: true, hide_session_name: false, + pane_title_alignment: Default::default(), }, capabilities: PluginCapabilities { arrow_fonts: false }, session_name: Some("my awesome test session".to_owned()), diff --git a/zellij-utils/src/plugin_api/style.rs b/zellij-utils/src/plugin_api/style.rs index eb9eebcf..2f3ff298 100644 --- a/zellij-utils/src/plugin_api/style.rs +++ b/zellij-utils/src/plugin_api/style.rs @@ -21,6 +21,11 @@ impl TryFrom<ProtobufStyle> for Style { colors: s, rounded_corners: protobuf_style.rounded_corners, hide_session_name: protobuf_style.hide_session_name, + // deliberately not carried over the plugin protobuf boundary; see + // the field docs on Style. Plugins never need the frame's title + // alignment, and adding a proto field would mean regenerating the + // committed prost assets. + pane_title_alignment: Default::default(), }) } } |
