On 9/10/2020 at 3:01 AM, Stefan said:
Sounds like a good idea.
If I understand, you mean automatic word wrap that inserts an actual line feed marker in the buffer. That might actually be possible to do.
In my first attempt I had word wrap that was calculated from the top of the paragraph without inserting any line feed markers. That became complicated.
An alternative is to use some other control char to mark automatic word wrap. If I remember correctly, WordStar used such an internal marker. The advantage is that you can strip the word wrap marker when saving to file.
Yes, inserting an actual return character.
The VDE approach (the MS-DOS shareware text editor, which originated as a CP/M editor ... back in the early 90's my AWK IDE was VDE and LIST) was that word wrap returns did not REPLACE the space, they were inserted AFTER the space, so the sequence "<space><return>" could be treated as a soft return, and return after any NON space character was a hard return (on the CX16, this would include SHIFT-SPACE, which is the non-break space $A0).
So you could set a new line length, select a set of lines, and the "rewrap" function would adjust the word wrap to suit for lines ending in soft returns, and leave lines ending in hard returns alone.
So, for instance, if you have a block comment and you decide you want to change it from 80 characters wide to 60 characters wide to make it easier to read, you can, without messing up any hard returned line oriented source code that you are commenting.
However you do insert mode, you can postpone rewrapping until the insert is over, to avoid rewrapping bogging down responsive of the insertion ... and then you only have to rewrap through to the first hard return.