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

completion within comment with interactivecomments



I've noticed that using completion after "#" with "setopt
interactivecomments" will always complete all executables, not taking
into account any prefixes.

% zsh -f
% autoload -U compinit
% compinit
% setopt interactivecomments
% foo # bar<TAB>
zsh: do you wish to see all X possibilities (Y lines)?

This is different with "git branch #<TAB>" however, which displays "--
no more arguments --".
Apparently this is coming from using _arguments?

I think the completion should either always complete nothing, or do
something smarter after comments, e.g. completing files/dirs only.

FWIW, using a custom compdef for "foo" gets not used.
That's what confused me, since "git branch" behaved different than my
function "gb" which uses a compdef to trigger _git_branch:

     compdef -e 'words=(git branch "${(@)words[2,-1]}"); ((CURRENT++));
_normal' gb



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