summaryrefslogtreecommitdiff
path: root/ex_vadj.c
diff options
context:
space:
mode:
authorThomas Ulmer <thomasmulmer02@gmail.com>2026-06-23 21:34:41 -0700
committerThomas Ulmer <thomasmulmer02@gmail.com>2026-06-23 21:34:41 -0700
commit874d317334fae1ddce316f9b6f4d0ce4e434bf52 (patch)
tree929f924d3c3696d3aa9917aca0e7048bbe3e93e8 /ex_vadj.c
parent15bd7946cc838a3151c357e4b0bc1ab85eecda62 (diff)
heirloom vi fixes from arch AUR
Diffstat (limited to 'ex_vadj.c')
-rw-r--r--ex_vadj.c18
1 files changed, 10 insertions, 8 deletions
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());
}
/*