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

Re: _files' default descriptions of globbed-files and all-files are identical



On 1/26/22 10:30, Daniel Shahaf wrote:


I've discussed this on IRC and Eric did not support the change.  If I
understand correctly (and I'm not sure I do), Eric'd prefer that the
completion function would use _path_files instead or that the user would
set the file-patterns style on a specific context.  Eric, please
add/correct this as needed.

Cheers,

Daniel

I'll try to be more clear:
My mention of _path_files over the use of _files was me mistakenly thinking
that you had a completer that you /only/ wanted to show files that
_files -g glob matches and when nothing does match, show nothing. which is the
behavior _path_files have; not looping over a preset of patterns as _files does.

Since the question is knowing which group of tags is being presented at the moment
in the minibuffer (though not really explained, i think are called `tab labels'
in man page), i don't think the use of _path_files appropriate since it wouldn't
solve what you want.

> +  pats=( "${${glob:-*}//:/\\:}:globbed-files:globbed\\ files *(-/):directories:directories" "*:all-files:other\\ files" )
When -g /isn't/ used ${glob:-*} expands to * for that tag label, changing the default
description from `file' to `globbed files'. which is something i don't think that you mean.
unless you invoke _next_tags, you ignore globbed-files and directories in tag-order
or use -g nonmatchingpattern you won't see the all-files tag.

completers have a style:

show-completer
       Tested whenever a new completer is tried.  If it is `true', the completion system  out‐
       puts a progress message in the listing area showing what completer is being tried.  The
       message will be overwritten by any output when completions are found and is removed af‐
       ter completion is finished.


that i think could be a way of showing which tag label is being tried, if the user
desired to know (show-taglabel or whatever). which is more generic than just
changing _files behavior.








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