I still don't understand what this conditonal is for:

1197    if (!sub)
1198            while (isu8cont((unsigned char)es->cbuf[--ncursor]))
1199                    continue;

I realized that what I did in my diff works with any false condition,
and it also works just changing the "continue;" above with a "break;".
I fact removing the conditional and just resting one to ncursor also
makes the job:

Index: vi.c
===================================================================
RCS file: /cvs/src/bin/ksh/vi.c,v
diff -u -p -r1.60 vi.c
--- vi.c        12 Mar 2021 02:10:25 -0000      1.60
+++ vi.c        5 Apr 2025 07:55:33 -0000
@@ -1194,9 +1194,7 @@ domove(int argcnt, const char *cmd, int 
                if (!sub && es->cursor + 1 >= es->linelen)
                        return -1;
                ncursor = (*cmd == 'e' ? endword : Endword)(argcnt);
-               if (!sub)
-                       while (isu8cont((unsigned char)es->cbuf[--ncursor]))
-                               continue;
+               --ncursor;
                break;
 
        case 'f':


-- 
Walter

Reply via email to