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_vadj.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'ex_vadj.c') diff --git a/ex_vadj.c b/ex_vadj.c index c579ee7..6b04cf2 100644 --- a/ex_vadj.c +++ b/ex_vadj.c @@ -110,11 +110,12 @@ vopen(line *tp, int p) tfixnl(), fprintf(trace, "vopen(%d, %d)\n", lineno(tp), p); #endif if (state != VISUAL) { - if (vcnt) + if (vcnt) { if (hold & HOLDROL) vup1(); else vclean(); + } /* * Forget all that we once knew. @@ -602,15 +603,16 @@ vrepaint(char *curs) /* * Deal with a totally useless display. */ - if (vcnt == 0 || vcline < 0 || vcline > vcnt || holdupd && state != VISUAL) { + if (vcnt == 0 || vcline < 0 || vcline > vcnt || (holdupd && state != VISUAL)) { register line *odol = dol; vcnt = 0; - if (holdupd) + if (holdupd) { if (state == VISUAL) ignore(peekkey()); else vup1(); + } holdupd = 0; if (odol == zero) fixzero(); @@ -708,7 +710,7 @@ vredraw(register int p) * search for first logical line affected by the redraw. */ vscrap(); - CP(temp, linebuf); + lcpy(temp, linebuf, LBSIZE); l = 0; tp = dot - vcline; if (vcnt == 0) @@ -920,7 +922,7 @@ vsync1(register int p) return; temp = smalloc(LBSIZE); vscrap(); - CP(temp, linebuf); + lcpy(temp, linebuf, LBSIZE); if (vcnt == 0) LINE(0) = WTOP; l = 0; @@ -935,7 +937,7 @@ vsync1(register int p) * the current line, or if this line is piled under the * next line (vreplace does this and we undo it). */ - if (l == 0 && state != VISUAL || + if ((l == 0 && state != VISUAL) || (l < vcnt && (vp->vliny <= p || vp[0].vliny == vp[1].vliny))) { if (l == 0 || vp->vliny < p || (vp->vflags & VDIRT)) { if (l == vcline) @@ -1056,7 +1058,7 @@ vreplace(int l, int cnt, int newcnt) * over them, since otherwise we will push them * slowly off the screen, a clear lose. */ - if (cnt == newcnt || vcnt - l == newcnt && AL && DL) { + if (cnt == newcnt || (vcnt - l == newcnt && AL && DL)) { if (cnt > 1 && l + cnt > vcnt) savenote++; vdirty(l, newcnt); @@ -1150,7 +1152,7 @@ sethard(void) vup1(); LINE(0) = WBOT; if (Pline == numbline) - vgoto(WBOT, 0), printf("%6d ", lineDOT()); + vgoto(WBOT, 0), ex_printf("%6d ", lineDOT()); } /* -- cgit v1.2.3