From: Johan Grande <nahoj@crans.org>
To: zsh-workers@zsh.org
Subject: _files -g <pattern> offers files that don't match the pattern and conversely
Date: Sat, 15 Jul 2023 15:31:57 +0200 [thread overview]
Message-ID: <bc471b8a-7338-9f11-367a-abfb9d1a510b@crans.org> (raw)
Are these bugs or am I misunderstanding how the -g option works?
With zsh 5.8.1 (x86_64-ubuntu-linux-gnu) and an empty .zshrc.
% ls
a b
% _f() { _files -g 'c(.)' }; compdef _f f
% f <tab>
a b # even though 'a' and 'b' don't match the pattern
However,
% _f() { _path_files -g 'c(.)' }; compdef _f f
% f <tab> # nothing
Conversely,
% _f() { _files -g '^(a #)(.)' }; compdef _f f
% f <tab> # nothing, even though 'b' matches the pattern
However,
% _f() { _path_files -g '^(a #)(.)' }; compdef _f f
% f <tab> # becomes
% f b
Also, and this is the same for _files and _path_files:
% f() { echo $@ }
% _f() { _files -g 'c' }; compdef _f f
% f <tab> # becomes
% f c # even though there is no such file
--
Johan Grande
next reply other threads:[~2023-07-15 13:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-15 13:31 Johan Grande [this message]
2023-07-15 13:34 ` Johan Grande
2023-07-15 16:16 ` Bart Schaefer
2023-07-15 16:51 ` Johan Grande
2023-07-15 21:28 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bc471b8a-7338-9f11-367a-abfb9d1a510b@crans.org \
--to=nahoj@crans.org \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).