thomas wrote:
 > 
 > I can bisect, etc., and see that this case (typing without spaces) never
 > did work as you expect (inserted text ok, cursor position not ok).

Oh, well that's a relief.  I haven't been missing anything, then!  H-)

But speaking of linewrap...

I've been realizing that with most of the world is reading email on
their phones these days, I should have a way of composing email that's
one paragraph to a line, so that the text wrapping on a narrow screen
gets a fighting chance.  I'm sure that if you read this message on a
phone it will look terrible.

vile's linewrap does the right thing with long lines, but there's no
easy way to move up and down vertically within a long wrapped line
that spans multiple screen lines.

Has anyone ever written a key binding that will go up and down by
screen lines (as opposed to real lines) when in linewrap mode?  (Or,
have I been oblivious, and is there already a way to do this?)

I.e., I want bindings that will move the cursor up and down throught
the same column in every line of the screen, whether part of a wrapped
line, or not.  Extra points for maintaining a "desired goal" column
when passing through a screen line that's too short.

I started trying to write stored procedures to do this, and have actually
gotten it to work in the forward/down direction, but going the other
way is kicking my butt.

Here's what I've got, going forward, if anyone's interested.

store-procedure forw-in-lw-line
        ~if &gt $lcols $curcol  
            ; unless we're at a line that's shorter than where we
            ; started, add another page width to our current column
            set-variable %nextcol &add $curcol $pagewid
        ~endif
        ~if &leq %nextcol $lcols
            ; our "next" column is still on the line, so go there
            ~force %nextcol goto-column
        ~else
            ; if we're trying to go past the end of the line, go to
            ; the next line, instead.
            ~force down-line-at-bol
            ~force &modulo %nextcol $pagewid goto-column
        ~endif 
~endm
bind-key forw-in-lw-line + 
bind-key forw-in-lw-line = 


You'd think going backward would be a simple inversion of the code,
it's harder than that.  For me, anyway!

paul

=----------------------
paul fox, [email protected] (arlington, ma, where it's 33.8 degrees)


Reply via email to