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

Re: Once more: "Do you wish to see all xxx possibilities?"

Andrej Borsenkow wrote:

> I still do not understand, when it is printed. Looking in Zle/compresult.c:
>     /* Maybe we have to ask if the user wants to see the list. */
>     if ((!minfo.cur || !minfo.asked) &&
> 	((complistmax && listdat.nlist > complistmax) ||
> 	 (!complistmax && listdat.nlines >= lines))) {
> It means, that it should ask if either complistmax is set (value of
> $compconfig[list_max]?) or number of lines exceeds $LINES. It seems, that Zsh
> sometimes gets incorrect count in listdat.nlines. Consider:

Many years ago, documentation was invented:

     In the line editor, the number of filenames to list without asking
     first.  If set to zero, the shell asks only if the top of the
     listing would scroll off the screen.

Even though `filenames' is definitely the wrong word here, I think it
should be clear enough.

And that's what the test you quoted above does. `complistmax' is the
atoi() of the value of `$compconfig[list_max]'. So, we ask if either
that is non-zero and the number of matches is larger than that value
or if the value is zero and the number of lines needed for the list is 
larger that the screen height.

In other words: if you only want the list if it fits on the screen,
set `LISTMAX=0'.


Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx

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