Skip to content

feat: word wrap composed strings to a specified width - #166

Merged
hlship merged 1 commit into
mainfrom
hlship/260903-wrap-composed
Sep 3, 2026
Merged

hlship merged 1 commit into
mainfrom
hlship/260903-wrap-composed

Conversation

@hlship

@hlship hlship commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds clj-commons.ansi/wrap to split a composed string into a sequence of composed strings for line wrapping
  • Supports soft wrap (word boundaries, wrap-point whitespace consumed) and hard wrap (mid-word at width)
  • Drops span :width/:align; preserves nested fonts; treats embedded newlines as forced breaks

Test plan

  • clojure -X:test
  • (wrap 10 [:red "Hello " [:bold "beautiful"] " world"]) yields three nested-font lines
  • Soft wrap of a long word overflows a single line; hard wrap splits at width
  • Trailing and consecutive newlines produce empty lines

@hlship
hlship marked this pull request as ready for review September 3, 2026 23:13
@hlship hlship self-assigned this Sep 3, 2026
@hlship hlship added this to the 3.9.0 milestone Sep 3, 2026
@hlship
hlship merged commit a6c3fde into main Sep 3, 2026
1 check passed
@hlship hlship changed the title feat: wrap composed strings feat: word wrap composed strings to a specified width Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant