Skip to content

Conversation

@altsem
Copy link
Owner

@altsem altsem commented Nov 13, 2025

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.

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
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.

2 participants