gitu icon indicating copy to clipboard operation
gitu copied to clipboard

wip: wrap words

Open altsem opened this issue 1 month ago • 0 comments

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 avatar Nov 13 '25 18:11 altsem