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

Re: Completion: setting up _approximate.



You haven't said what version of zsh you are using, that may be significant.

On Fri, Jul 7, 2017 at 2:17 AM, Kamil <crs@xxxxxxxxx> wrote:
>
> I am trying to get following string in zle:
>
> /v/m/s/f/3
>
> completed to:
>
> /Volumes/Media/Series/Fargo/Season\ 03
>
> What I am getting instead is:
>
> ── corrections (errors: 1) ──
> Season\ 01/  Season\ 02/  Season\ 03/

Those choices are obviously coming from _approximate, so the first
thing to try is to remove that from your completer style and see what
you get.  _match should be doing nothing because there are no patterns
in your initial string, but both it and _approximate should be called
only when _complete returns nonzero.

Please confirm that you're completing this in command position, for
use with autocd.

> When I type /v/m/s/f/*3<tab> (note *) zle gets cleared instead.

Yes, that's a known issue when the ambiguity occurs too early in the
string; completion is attempting to restrict the view only to the
shortest common prefix, but sometimes that's empty and the effect is
to erase everything.

> I was trying to configure matcher-list but couldn't figure out how to
> make that work.

There's nothing inherently wrong with the matcher-list that you showed us.



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