Skip to content

fix(components): render full-width spaces in Spacer#55

Merged
yumosx merged 1 commit into
mainfrom
spacer-render-width
May 12, 2026
Merged

fix(components): render full-width spaces in Spacer#55
yumosx merged 1 commit into
mainfrom
spacer-render-width

Conversation

@yumosx

@yumosx yumosx commented May 12, 2026

Copy link
Copy Markdown
Member

Previously, Spacer.Render(width) returned lines containing only a single space character, ignoring the width parameter entirely. This caused Spacer to collapse to 1 character wide regardless of the container width, breaking layout when used inside Box or other width-aware components.

Fix:

  • Change each line to strings.Repeat(" ", width) so Spacer occupies the full available width.
  • Add comprehensive tests covering single/multi lines, zero width, zero lines, width=1, and large width scenarios.
  • Add strings import required by the fix.

Previously, Spacer.Render(width) returned lines containing only a
single space character, ignoring the width parameter entirely. This
caused Spacer to collapse to 1 character wide regardless of the
container width, breaking layout when used inside Box or other
width-aware components.

Fix:
- Change each line to strings.Repeat(" ", width) so Spacer occupies
  the full available width.
- Add comprehensive tests covering single/multi lines, zero width,
  zero lines, width=1, and large width scenarios.
- Add strings import required by the fix.
@yumosx
yumosx merged commit ec5939c into main May 12, 2026
4 checks passed
@yumosx
yumosx deleted the spacer-render-width branch May 12, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant