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

Re: Proposal: Let compinit make standard widgets with _generic instead of _main_complete



On Mon, Mar 22, 2021, at 3:16 AM, Marlon Richert wrote:
> On Mon, Mar 22, 2021 at 3:46 AM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> > It refers to the completion results being generic, not to the context ... but of course the style can be called anything, it's more the functionality that's in question.
> 
> On Sun, Mar 21, 2021 at 1:53 AM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> > +if [[ "${curcontext:-:::}" == ::: ]] &&
> > +   zstyle -t ":completion:::::" generic-widgets "$WIDGET"
> > +then
> > +    _generic "$@"
> > +    return
> > +fi
> 
> This feels like a rather roundabout solution. _generic itself already
> checks whether $curcontext is set and then calls _main_complete. Why
> not just do the straightforward thing, and let the widget call
> _generic directly, which in turn will call _main_complete anyway?

Anything else on this?

vq




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