Skip to content

wip: wrap words - #455

Merged
altsem merged 2 commits into
masterfrom
feat/text-wrap
Jul 26, 2026
Merged

wip: wrap words#455
altsem merged 2 commits into
masterfrom
feat/text-wrap

Conversation

@altsem

@altsem altsem commented Nov 13, 2025

Copy link
Copy Markdown
Owner

Here's a sketch on how far i got into trying to make (at least) word-wrap a thing. Since it's just word-wrap, it won't deal with very long single- word lines still. (Should the layout module be able to split spans?).

This still doesn't solve the problem if the Editor (src/screen/mod.rs) not being aware of wrapped lines.

I think either we'll have to:

  • Feed data from the Layout back to the Editor. How tall is each Item? Is there a way to scroll the screen without recomputing from the top? Maybe keep an Item as anchor: "We are 7 lines down from Item 42"

  • Do wrapping separately from (or with the help of?) the Layout module. Keep each Item = 1 line. When the internal model is constructed, split long lines into multiple items. Make them behave as if 1 when selecting etc.

@altsem altsem mentioned this pull request Nov 13, 2025
@altsem
altsem force-pushed the feat/text-wrap branch 4 times, most recently from e989baa to cbfd679 Compare July 26, 2026 00:46
altsem added 2 commits July 26, 2026 03:15
- update screen to be able to navigate with multi-line items
- change screen mod to orient around items instead of lines
- bug-fixes and support for x/y fill (previously called `grow`) in layout mod
A lot of changed on this branch, so I'm porting your PR into here @cedricpinson

closes: #539
@altsem
altsem marked this pull request as ready for review July 26, 2026 11:46
@altsem
altsem merged commit 312ce9e into master Jul 26, 2026
1 of 3 checks passed
@altsem
altsem deleted the feat/text-wrap branch July 26, 2026 11:46
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