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

Is _oldlist breaking something it shouldn't?

This is less interesting than I first thought, because I didn't catch the
no_automenu interaction the first time around, but since I already typed
most of it ...

On Feb 12,  9:47pm, Bart Schaefer wrote:
} The first time you press TAB, if the result is ambiguous (in your
} example, four possible results) a completion listing and the cursor
} is moved to the first disambiguating location.

I've verified by repeated experiment that this is the default behavior
of compsys in emacs mode if you load it with no styles and the default
zsh setopts.  

I've also verified that it works this way if you add a simple completer

    zstyle ':completion:*' completer _complete

And that it continues to work this way if you "unsetopt automenu".

} If you hit TAB again, the same completion that created the listing
} is repeated in order to populate the menu.  If you were to replay it
} in slow motion, you'd see the cursor return to the end of the word
} before the completion is begun, and then jump back to the point of
} disambiguation to insert the first choice from the menu.

As expected, this only works with automenu set.  However, the cursor
remains at the disambiguation point when TAB is pressed again.

Here comes the "is this a bug?" ...

} The _oldlist completer takes explicit advantage of this behavior to
} avoid calling all the other completers when a list has already been
} created.

If I change that completer style to:

    unsetopt automenu
    zstyle ':completion:*' completer _oldlist _complete

Now the cursor returns to the end of the word on the second TAB.  Why
should _oldlist have that side-effect?  Why does it have that side-effect
only when automenu is turned off?

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