zsh-workers
 help / color / mirror / code / Atom feed
* _files -g <pattern> offers files that don't match the pattern and conversely
@ 2023-07-15 13:31 Johan Grande
  2023-07-15 13:34 ` Johan Grande
  2023-07-15 16:16 ` Bart Schaefer
  0 siblings, 2 replies; 5+ messages in thread
From: Johan Grande @ 2023-07-15 13:31 UTC (permalink / raw)
  To: zsh-workers

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-07-15 21:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-15 13:31 _files -g <pattern> offers files that don't match the pattern and conversely Johan Grande
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

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