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

Re: Completion: setting up _approximate.



On 08/07/17 14:24, Bart Schaefer wrote:
> You haven't said what version of zsh you are using, that may be
> significant.

Hey Bart,

thanks for your response.

I am on zsh 5.3.1 (x86_64-apple-darwin16.6.0), as you can see this is on
Mac OS.

>> /v/m/s/f/3
>>
>> completed to:
>>
>> /Volumes/Media/Series/Fargo/Season\ 03
>>
>> What I am getting instead is:

Should have said that all but last parts are matched correctly: I get it
expanded to: /Volumes/Media/Series/Fargo/Season\ 01/ with menu printed.

> 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.

No matches found, when I remove _approximate from completer list.

(that's my format for warnings)

> _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.

I tried /v/m/s/f/S3, still completes to Season\ 01.

But /v/m/s/f/S*3 and /v/m/s/f/*3 works fine so I assume _match is doing
its job properly.

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

Correct, /v/m/s/f/3 is the only string in buffer. I also tried with cd
command, with same results.

>> 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.

Reverted to my previous:

zstyle ':completion:*' matcher-list \
    '' \
    'm:{a-zA-Z}={A-Za-z}' \
    'r:|[._-]=* r:|=*' \
    'l:|=* r:|=*'

as I was getting some issues with the other one. Just letting you know
in case it actually changes anything.

Thanks,

-- 
Kamil



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