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

Re: problem with context specification



On Mon, Jan 13, 2020 at 8:57 AM Peter Stephenson
<p.stephenson@xxxxxxxxxxx> wrote:
>
> I've a feeling matcher-list is only run in a very general context, so
> updating per command doesn't work, and you need to use the matcher style
> for more specific cases.

Yes, that's exactly it.  matcher-list is an oddball that gets queried
before the individual completers are called, so it never has the
fully-formed context string.  It populates the default _matchers array
at the top level of _main_complete, which is then overridden by the
matcher style when _descriptions is called after the context is filled
out.

The documentation comes at this sort of sideways; under matcher-list we find:

              It is possible to create match specifications valid for particu-
              lar  completers  by  using the third field of the context.  This
              applies  only   to   completers   that   override   the   global
              matcher-list, which as of this writing includes only _prefix and
              _ignored.



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