Skip to content

Soft-wrap an input's lines, and add a :wrapped text element - #1

Merged
yogthos merged 1 commit into
mainfrom
soft-wrap
Sep 24, 2026
Merged

yogthos merged 1 commit into
mainfrom
soft-wrap

Conversation

@yogthos

@yogthos yogthos commented Sep 24, 2026

Copy link
Copy Markdown
Member

FTXUI's Input draws one row per line, so a long line runs off the side, and paragraph clips a word wider than the row.

:input {:wrap true} draws the content as the rows it takes at the width the layout gives it, breaking after a space where it can and inside a word where it cannot. The box is as tall as its rows within the same frame (the element re-lays itself out through Node::Check once it learns its width), and Up/Down and a mouse click move by those rows. Without :wrap the input is unchanged.

:wrapped is the same layout for plain text, whitespace kept.

Only FTXUI's public headers are used, so building against an installed FTXUI still works. Tests: 9 new assertions across render_test and dom_test, which fail with wrap off; suite 51/0 locally.

FTXUI's Input draws one row per line, so a long line runs off the side,
and paragraph clips a word wider than the row. :input {:wrap true} draws
the content as the rows it takes at the width the layout gives it,
breaking after a space where it can and inside a word where it cannot;
the box is as tall as its rows within the same frame, and Up/Down and a
click move by those rows. :wrapped is the same layout for plain text,
with whitespace kept.

Only FTXUI's public headers are used, so an installed FTXUI still works.
@yogthos
yogthos merged commit 79de04c into main Sep 24, 2026
2 checks passed
@yogthos
yogthos deleted the soft-wrap branch September 24, 2026 00:34
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