> Most of the word movement functions required complete rewrites,
> but the new versions aren't harder to read than the old ones.
> 
> I have done some testing, but a bit more might be in order.
> 
> OK?

The patch reads fine to me and behaves well in some testing.
It is ok tb@ as is.

I wonder if for the sake of consistency it would be worth merging the
'b' and 'B' cases as well as the 'w' and 'W' cases the same way as you
did merge the 'e' and 'E' cases below. The simplification is minimal,
but it would read slightly better, I think.

> @@ -1180,19 +1181,13 @@ domove(int argcnt, const char *cmd, int 
>               break;
>  
>       case 'e':
> -             if (!sub && es->cursor + 1 >= es->linelen)
> -                     return -1;
> -             ncursor = endword(argcnt);
> -             if (sub && ncursor < es->linelen)
> -                     ncursor++;
> -             break;
> -
>       case 'E':
>               if (!sub && es->cursor + 1 >= es->linelen)
>                       return -1;
> -             ncursor = Endword(argcnt);
> -             if (sub && ncursor < es->linelen)
> -                     ncursor++;
> +             ncursor = (*cmd == 'e' ? endword : Endword)(argcnt);
> +             if (!sub)
> +                     while (isu8cont((unsigned char)es->cbuf[--ncursor]))
> +                             continue;

Reply via email to