✨ feat(renderer): let widgets opt out of powerline auto-align#489
Merged
sirmalloc merged 3 commits intoJun 30, 2026
Conversation
In powerline auto-align mode every widget is padded so its column lines up with the widget above and below it. A single wide widget, such as a long git branch, therefore stretches that column on every other line and wastes horizontal space. Add an `excludeFromAutoAlign` flag. A flagged widget, and everything after it on the same line, stops contributing to the shared column widths and stops receiving alignment padding, so it keeps its natural width while the columns before it stay aligned. The items editor exposes an `e(x)clude align` toggle and a `(no-align)` marker, shown only when powerline auto-align is on.
Only allow excludeFromAutoAlign to be toggled from the items editor when powerline auto-align is active and the selected widget is not merged into a previous widget. This keeps the shortcut behavior aligned with the visible help text and prevents hidden exclusions from being persisted while the feature is unavailable. Treat no-align as a merge-chain-head option in the UI, so widgets merged into a previous item no longer show an effective no-align marker. The renderer keeps merged-in widgets participating in their parent group width while still honoring exclusions on the first widget in the chain. Add regression coverage for merged no-align width calculation and for the editor shortcut gate.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In powerline auto-align mode every widget is padded so its column lines up with the widget directly above and below it. ✨ That vertical alignment is the whole point of the mode, but it has a sharp edge: one wide widget, such as a long git branch or repository name, stretches its column on every other line too, so a short value on another line carries a trail of padding and the bar wastes horizontal space.
This adds an
excludeFromAutoAlignflag on a widget. A flagged widget, and everything after it on the same line, stops contributing to the shared column widths and stops receiving alignment padding, so it keeps its natural width while the columns before it stay aligned. 📏 The two sides of the renderer move together:calculateMaxWidthsFromPreRenderedskips the rest of the line once it reaches a flagged widget, and the powerline render path skips padding from the same point. The items editor exposes ane(x)clude aligntoggle and a(no-align)marker, both shown only when powerline auto-align is on, so the option appears where it has an effect.This is the design suggested in #349 and #350, where per-line column widths were proposed to solve the same long-branch problem. Default behavior is unchanged: a widget aligns exactly as before until the flag is set.