Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Why does _main_complete not try the next completer when $_comp_mesg is non-zero?
- X-seq: zsh-workers 48289
- From: Marlon Richert <marlon.richert@xxxxxxxxx>
- To: Mikael Magnusson <mikachu@xxxxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: Why does _main_complete not try the next completer when $_comp_mesg is non-zero?
- Date: Sun, 28 Mar 2021 20:27:50 +0300
- Archived-at: <https://zsh.org/workers/48289>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2021-03/CAHLkEDsbF3o6SDCeCL0ye4LE_JnucMm%2BSOGSDnUjoLRfhUpjzg%40mail.gmail.com>
- In-reply-to: <CAHYJk3QDuG+Y7xKhcRdFVHNakiMgM=hZokJ8VhUHdpwOCJFNGQ@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAHLkEDt+5xiu62fLb2Gp9gQOh9Q_o8+-He64fooMMxPceon4vA@mail.gmail.com> <CAHYJk3QDuG+Y7xKhcRdFVHNakiMgM=hZokJ8VhUHdpwOCJFNGQ@mail.gmail.com>
On Sun, Mar 28, 2021 at 8:10 PM Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
> On 3/28/21, Marlon Richert <marlon.richert@xxxxxxxxx> wrote:
> > The following line in _main_complete
> >
> > [[ -n "$_comp_mesg" ]] && break
> >
> > has the effect that, whenever _message has been called (with only few
> > exceptions), the next completer won't be tried, _even when
> > $compstate[nmatches] is zero._
> >
> > Why? What is the reason for this?
>
> I haven't tested this, but I suspect that if this check were not
> there, then loops due to approximate matching would print the message
> multiple times.
Nope:
% autoload -Uz compinit; compinit
% zstyle '*' format '%d'
% _tst() { repeat 10; do _message -e 'TEST'; done }
% compdef _tst tst
% tst \t
TEST
%
Messages sorted by:
Reverse Date,
Date,
Thread,
Author