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

[BUG] _expand completer's all-expansions tag format style does not expand %o



I have found a bug with the _expand completer regarding the format style.
zshcompsys(1) states the following about the _expand completer:

    The format string for all-expansions and for expansions may contain the
    sequence `%o' which will be replaced by the original string from the
line.

However, the all-expansions tag does not actually expand %o unlike the
expansions tag. I am using zsh v5.2, but have confirmed the bug's presence
upstream as well. This behavior can be reproduced as follows:

* Include the _expand completer in your completer style
* bindkey '^I' complete-word
* zstyle ':completions:*:*expansions' format '>%d for [%o]'

% cd $(mktemp -d)
% touch foo bar
% print *<TAB>
>expansions for [*]
bar foo
>all-expansions for []
bar foo

I believe the problem is the lack of a

     _description all-expansions expl all-expansions "o:$word"

line in Completion/Base/Completer/_expand. I was able to fix the issue by
adding
that line under line 210 of the _expand completer, but I don't know enough
about the completion system guts to determine if this is the ideal solution
or
not.

I don't believe I have received a subscription confirmation email yet, so
would
you kindly CC replies to xzeroknightx [AT] gmail [DOT] com ?

Regards,
Alex George


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