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

Re: [bug] completion makes input jump up one line



Geoff Wing <mason@xxxxxxxxxxxxxxx> typed:
: Mikael Magnusson <mangosoft@xxxxxxxxx> typed:
:: under 4.1, if i tabcomplete, and one of the matches in the list is a=20
:: multiple of $COLUMNS, ie, if the last letter of the match is in the=20
:: rightmost column, the whole thing jumps up one line. i confirmed it with=20
:: caphuso on #zsh, it happens in 4.1, but not 4.0
:
: I can reproduce this with:
:  % zsh -f
:  % setopt alwayslastprompt
: I'm guessing the calculation in calclist() needs correction.

Does this look right?

--- Zle/compresult.c	6 Feb 2003 10:29:34 -0000	1.48
+++ Zle/compresult.c	27 Feb 2004 01:02:01 -0000
@@ -1573,10 +1573,10 @@
 			if (!(m->flags & CMF_HIDE)) {
 			    if (m->disp) {
 				if (!(m->flags & CMF_DISPLINE))
-				    glines += 1 + (mlens[m->gnum] / columns);
+				    glines += 1 + ((mlens[m->gnum] - 1) / columns);
 			    } else if (showall ||
 				       !(m->flags & (CMF_NOLIST | CMF_MULT)))
-				glines += 1 + ((mlens[m->gnum]) / columns);
+				glines += 1 + (((mlens[m->gnum]) - 1) / columns);
 			}
 		}
 	    }



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