Repository navigation
fix(renderer): end auto-align merge groups at a hidden widget that isn't merged onward - #74
Merged
Merged
Conversation
A merged widget joined the next widget that rendered anything, skipping over widgets that rendered nothing. So with Session Usage merged into a widget that hides itself, the hidden widget took the merge with it to whatever followed: the separator vanished and, in Powerline, every later segment shifted one theme color. A merge now carries past an empty widget only when that widget is merged onward too; otherwise it ends there and the usual boundary returns. The Powerline, plain and auto-align paths all follow the same rule.
… into fix/merge-hidden-align # Conflicts: # src/utils/renderer.ts
…n't merged onward
# Conflicts: # docs/USAGE.md
# Conflicts: # docs/USAGE.md
…rs too The Powerline renderer now ends a merge at a widget that renders nothing and isn't merged onward: A (merged), an empty unmerged widget, then B draws a separator between A and B and gives B its own theme color. The per-line counters that tell the next line where to pick up the separator and theme-color cycles still followed the old rule and carried the merge past every empty widget, so they counted one separator and one color fewer than the line drew. On a multi-line Powerline status line that put the next line one step behind: its first separator repeated the previous glyph and, with Continue Theme Across Lines on, its first segment reused the color of the segment before it. Git Branch merged with Git Ahead/Behind hits this whenever the branch is in sync. The TUI preview uses the same counters, so it showed the same. countSeparatorSlots and assignPowerlineThemeSlots now drop the pending merge when they skip an empty widget that isn't merged onward, matching the renderer. A merge still carries past empty widgets that are merged onward themselves.
countSeparatorSlots had grown a branch per kind of widget inside its loop. Each widget's effect on the count now lives in advanceSeparatorSlots, which keeps the loop to one call and puts the rules for separators, flex separators, hidden widgets and shown widgets side by side. No change in behavior.
|
Owner
Author
|
Folded into #14: with #73 upstream as sirmalloc#698, #14 now meets #73's rule itself, so this fix moved there. |
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.



Builds on #14 (
feat/bar-width) and merges #73 (fix/merge-across-hidden-widgets). Fork-only: it makes the two work together innext, like #52 does for #14 and #49.What
#14 moved the auto-align column widths into
getAlignmentColumns(), with its ownhasRenderedWidgetBeforeSeparator()helper deciding whether a merge reaches the next rendered widget. #73 changes that rule everywhere it lived onmain, but this helper only exists on #14's side, so merging the two kept the old rule here. This branch applies #73's rule to it: a merge carries past an empty widget only if that widget is merged onward too.Why
Without it, auto-align would still treat
A (merged) → hidden B → Cas one merge group while the renderer draws A and C as separate segments, so the shared column widths wouldn't match the line.How
origin/fix/merge-across-hidden-widgetsintofeat/bar-width; the conflict incalculateMaxWidthsFromPreRenderedkeeps feat(widgets): bar style, size and numbers for progress bars #14'sgetAlignmentColumns()version.hasRenderedWidgetBeforeSeparator(), with its comment updated.main's newer commits thatfeat/bar-widthdoesn't have yet (README, git-remote, Git Is Fork); they're not part of this change.Testing
bun test: 3181 pass, 0 fail.bun run lintpasses.