From b17025b3999c53d5bfaba2aa35f7797adf2eb1a2 Mon Sep 17 00:00:00 2001 From: Edward Wang Date: Tue, 5 Aug 1986 07:17:20 -0800 Subject: [PATCH] delay calling wwupdate1() until cursor moved off this line or a insert/delete line SCCS-vsn: usr.bin/window/wwwrite.c 3.24 --- usr/src/usr.bin/window/wwwrite.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/usr/src/usr.bin/window/wwwrite.c b/usr/src/usr.bin/window/wwwrite.c index b383e703e3..4fb7448f59 100644 --- a/usr/src/usr.bin/window/wwwrite.c +++ b/usr/src/usr.bin/window/wwwrite.c @@ -1,5 +1,5 @@ #ifndef lint -static char sccsid[] = "@(#)wwwrite.c 3.23 %G%"; +static char sccsid[] = "@(#)wwwrite.c 3.24 %G%"; #endif /* @@ -108,12 +108,8 @@ int n; ns[i].c_w = bp[i].c_w ^ win[i] << WWC_MSHIFT; } - if (nchanged > 0) { + if (nchanged > 0) wwtouched[w->ww_cur.r] |= WWU_TOUCHED; - if (!w->ww_noupdate) - wwupdate1(w->ww_cur.r, - w->ww_cur.r + 1); - } } chklf: if (w->ww_cur.c >= w->ww_w.r) @@ -126,6 +122,8 @@ int n; crlf: w->ww_cur.c = w->ww_w.l; lf: + if (!w->ww_noupdate && wwtouched[w->ww_cur.r]) + wwupdate1(w->ww_cur.r, w->ww_cur.r + 1); if (++w->ww_cur.r >= w->ww_w.b) { w->ww_cur.r = w->ww_w.b - 1; if (w->ww_w.b < w->ww_b.b) { @@ -163,6 +161,8 @@ int n; break; case 'A': up: + if (!w->ww_noupdate && wwtouched[w->ww_cur.r]) + wwupdate1(w->ww_cur.r, w->ww_cur.r + 1); if (--w->ww_cur.r < w->ww_w.t) { w->ww_cur.r = w->ww_w.t; if (w->ww_w.t > w->ww_b.t) { @@ -190,6 +190,8 @@ int n; wwclreos(w, w->ww_w.t, w->ww_w.l); break; case 'H': + if (!w->ww_noupdate && wwtouched[w->ww_cur.r]) + wwupdate1(w->ww_cur.r, w->ww_cur.r + 1); w->ww_cur.r = w->ww_w.t; w->ww_cur.c = w->ww_w.l; break; @@ -200,6 +202,8 @@ int n; wwclreol(w, w->ww_cur.r, w->ww_cur.c); break; case 'L': + if (!w->ww_noupdate && wwtouched[w->ww_cur.r]) + wwupdate1(w->ww_cur.r, w->ww_cur.r + 1); wwinsline(w, w->ww_cur.r); break; case 'M': @@ -212,6 +216,8 @@ int n; w->ww_insert = 0; break; case 'Y': + if (!w->ww_noupdate && wwtouched[w->ww_cur.r]) + wwupdate1(w->ww_cur.r, w->ww_cur.r + 1); w->ww_wstate = 2; break; case 's': -- 2.20.1