Skip to content

fix(help): add styled whitespace with configurable background#685

Open
rrrodzilla wants to merge 4 commits intocharmbracelet:masterfrom
rrrodzilla:fix-bug-571
Open

fix(help): add styled whitespace with configurable background#685
rrrodzilla wants to merge 4 commits intocharmbracelet:masterfrom
rrrodzilla:fix-bug-571

Conversation

@rrrodzilla
Copy link

Added WhitespaceStyle fields to both short and full help Styles struct, llowing customization of whitespace appearance between keys and descriptions. Previously whitespace was unstyled, now it matches the aesthetic of other elements and can be customized (e.g. with background colors for testing).

  • Added ShortWhitespace and FullWhitespace to Styles struct
  • Modified ShortHelpView to use styled whitespace between key and desc
  • Modified FullHelpView to use styled whitespace between key and desc
  • Added tests to verify whitespace styling behavior

Fixes #571

Added WhitespaceStyle fields to both short and full help Styles struct,
llowing customization of whitespace appearance between keys and descriptions.
Previously whitespace was unstyled, now it matches the aesthetic of other
elements and can be customized (e.g. with background colors for testing).

- Added ShortWhitespace and FullWhitespace to Styles struct
- Modified ShortHelpView to use styled whitespace between key and desc
- Modified FullHelpView to use styled whitespace between key and desc
- Added tests to verify whitespace styling behavior

Fixes charmbracelet#571
@adamgoose
Copy link

Looks like this whitespace between the truncated keys and the ellipsis remains unstyled.

tail = " " + m.Styles.Ellipsis.Inline(true).Render(m.Ellipsis)

@bashbunni bashbunni added the enhancement New feature or request label Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lack of Style Options for Spaces Between Key and Description in Short Help View

4 participants