Add flexible spacers to custom statusline layouts (#64009)

## Why

Statusline authors can set fixed gaps or justify a whole row. An expandable gap lets them place a field at the far edge by putting a spacer between it and the other fields.

## What changed

Add the empty `spacer` element to the statusline renderer and its bundled TypeScript contract. Spacers share the remaining width on each wrapped row line before `justify` is applied. In columns stretched by a taller sibling, spacers share the added height.

## Testing

Add renderer tests for wrapped and nested layouts, background fill, and clipping. Cover empty spacer declarations and reject spacer children in the parser and TypeScript contract tests.

GitOrigin-RevId: d8bb58304b2a1f10ac0c60ec198aa3c25a169cae
This commit is contained in:
Joe Savona
2026-11-25 22:51:18 +00:00
committed by copyberry
parent 163c555f18
commit 8d8de8f693
9 changed files with 556 additions and 205 deletions
@@ -30,6 +30,7 @@ fn statusline_typescript_contract_matches_the_bundled_reference() -> color_eyre:
"RowElement",
"ColElement",
"BoxElement",
"SpacerElement",
"CodeElement",
"StatuslineItemId",
"Color",
@@ -70,6 +71,7 @@ fn generate_reference(output: &Path) -> color_eyre::Result<String> {
"Row",
"Col",
"Box",
"Spacer",
"Code",
] {
let tag = name.to_ascii_lowercase();