Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

zle_refresh.c bug fix



Heyla, as Wayne Davison pointed out in message 252, I made an error in my
 patch in message 164.  The patch below will fix it.  I must have been 
 thinking of some possible exception when I wrote it, but when I looked
 at it before, there didn't seem to be any such.  Strange things must be
 happening with my mind's logic processes.  Anyway, it's a unidiff to
 base + my patch (in 164) only (I think).



--- zle_refresh.c.~1~	Fri Jul  7 12:32:32 1995
+++ zle_refresh.c	Tue Jul 25 17:28:16 1995
@@ -470,15 +470,14 @@
     for (;;) {
     /* skip past all matching characters */
 	for (; *nl && (*nl == *ol); nl++, ol++, ccs++) ;
 
 	if (!*nl) {
-	    if ((char_ins <= 0)	|| (vcs >= winw))  /* written everything */
+	    if ((char_ins <= 0)	|| (ccs >= winw))  /* written everything */
 		return;
 	    else		/* we've got junk on the right yet to clear */
-		if (tccan(TCCLEAREOL) && (char_ins >= tclen[TCCLEAREOL])
-		    && ccs < winw)
+		if (tccan(TCCLEAREOL) && (char_ins >= tclen[TCCLEAREOL]))
 		    col_cleareol = 0;	/* force a clear to end of line */
 	}
 
 	moveto(ln, ccs);	/* move to where we do all output from */
 
@@ -489,16 +488,15 @@
 	    return;
 	}
 
     /* we've written out the new but yet to clear rubbish due to inserts */
 	if (!*nl) {
-	    if ((i = (winw - ccs < char_ins ? winw - ccs : char_ins)) == 0)
-		return;
+	    i = (winw - ccs < char_ins) ? (winw - ccs) : char_ins;
 	    if (tccan(TCDEL) && (tcdelcost(i) <= i + 1))
 		tc_delchars(i);
 	    else {
-		SELECT_ADD_COST(i);	
+		SELECT_ADD_COST(i);
 		vcs += i;
 		while (i-- > 0)
 		    putc(' ', shout);
 	    }
 	    return;




--
Mason [G.C.W]  mason@xxxxxxxxxxxxxxxxxx     Hurt...Agony...Pain...LOVE-IT



Messages sorted by: Reverse Date, Date, Thread, Author