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

Re: _files -g <pattern> offers files that don't match the pattern and conversely



Le 15/07/2023 à 18:16, Bart Schaefer a écrit :
On Sat, Jul 15, 2023 at 6:32 AM Johan Grande <nahoj@xxxxxxxxx> wrote:

% _f() { _files -g 'c(.)' }; compdef _f f
% f <tab>
a  b       # even though 'a' and 'b' don't match the pattern

The only way I can make this happen is if "a" and "b" are directories.
_files will complete local directory names if there are no matching
files.

In my test they are regular files, but the problem disappears if I replace /usr/share/zsh/functions/Completion/ with that of zsh 5.9, so it seems that this one was fixed.

[...]
% _f() { _files -g 'c' }; compdef _f f
% f <tab>  # becomes
% f c      # even though there is no such file

There's only one possible completion, so it's offered.

OK, thank you.

--
Johan





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