From 874d317334fae1ddce316f9b6f4d0ce4e434bf52 Mon Sep 17 00:00:00 2001 From: Thomas Ulmer Date: Tue, 23 Jun 2026 21:34:41 -0700 Subject: heirloom vi fixes from arch AUR --- ex_voper.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'ex_voper.c') diff --git a/ex_voper.c b/ex_voper.c index 5cb693e..07df03b 100644 --- a/ex_voper.c +++ b/ex_voper.c @@ -159,7 +159,7 @@ operate(register int c, register int cnt) * c Change operator. */ case 'c': - if (c == 'c' && workcmd[0] == 'C' || workcmd[0] == 'S') + if ((c == 'c' && workcmd[0] == 'C') || workcmd[0] == 'S') subop++; moveop = vchange; deleteop = (void (*)(int))beep; @@ -492,13 +492,13 @@ fixup: */ case 'l': case ' ': - forbid (margin() || opf == vmove && edge()); + forbid (margin() || (opf == vmove && edge())); while (cnt > 0 && !margin()) { wcursor += dir>0 ? skipright(linebuf, wcursor) : skipleft(linebuf, wcursor); cnt--; } - if (margin() && opf == vmove || wcursor < linebuf) + if ((margin() && opf == vmove) || wcursor < linebuf) wcursor -= dir; vmoving = 0; break; @@ -838,7 +838,7 @@ find(int c) int word(register void (*op)(int), int cnt) { - register int which = 0, i; + register int which, i; register char *iwc; register line *iwdot = wdot; @@ -881,6 +881,7 @@ word(register void (*op)(int), int cnt) while (!margin() && wordof(which, wcursor)) wcursor--; } + which = wordch(wcursor); if (wcursor < linebuf || !wordof(which, wcursor)) wcursor += skipright(linebuf, wcursor); } -- cgit v1.2.3