[Toybox] [PATCH] vi: semi-functional ^E/^U and ^F/^B.

Jarno Mäkipää jmakip87 at gmail.com
Sun Mar 15 01:07:10 PDT 2020


Hi Elliott,

Havent implemented any of these <control> modifier movements myself
yet, since I rarely use them. But they might be indeed handy.

I applied to my local branch and they seem to be semi working, and all
the previous tests pass, so looks good in that way.

But I think these should be later implemented as vi_ctrl_B(),
vi_ctrl_E()... and let the vi_movs[]  launcher execute them so they
could respect [register, count0, count1] parsing. Im not sure can
these be used as movement operation for delete/yank/change but atleast
posix spec says they should handle count.

That being said, I think rest of the vi_main() switch cases should be
removed (either that or remove the cmd parsing logic and do everything
with switch cases).


On Sun, Mar 15, 2020 at 8:36 AM enh via Toybox <toybox at lists.landley.net> wrote:
>
> The forward movement seems okay (no worse than the equivalent arrow key
> movement), but I haven't yet worked out how to move the cursor back when
> necessary.

You could do text_psol(TT.cursor) and text_psol(TT.screen) same time
when their "row distance" is at maximum screen_height
but you need to count line endings between these 2 locations to know
their row distance....

x (column pos) should be indeed applied after some of these movements,
but I didint rewrite the logic to cur_up/cur_down yet after the buffer
rework, since logic needs to respect utf8 and unicode.


-Jarno


>
> Also fix the location of the cursor in ex mode, and stop showing ex
> commands in bold.
> ---
>  toys/pending/vi.c | 30 +++++++++++++++++++++++++-----
>  1 file changed, 25 insertions(+), 5 deletions(-)
> _______________________________________________
> Toybox mailing list
> Toybox at lists.landley.net
> http://lists.landley.net/listinfo.cgi/toybox-landley.net



More information about the Toybox mailing list