Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: pws-21: multiple -X in compadd
- X-seq: zsh-workers 6554
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: Re: pws-21: multiple -X in compadd
- Date: Wed, 9 Jun 1999 16:36:02 +0200 (MET DST)
- In-reply-to: "Andrej Borsenkow"'s message of Wed, 9 Jun 1999 16:53:38 +0400
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
Andrej Borsenkow wrote:
> cursh> foo() {
> cursh function> compadd -J 1 -X "Options set 1" a111x a111y
> cursh function> compadd -J 2 -X "Options set 2" a222x a222y
> cursh function> }
> cursh> }
> itsrm2% compdef foo foo
> itsrm2% foo a<TAB>
> itsrm2% foo a
> Options set 1
> a111x a111y
> Options set 2
> a222x a222y (press TAB once more)
> itsrm2% foo a111x
> Options set 1Options set 2
Two bugs (obviously): the missing newline and the fact that the list
wasn't just left alone. Guess what I forgot to do for the first
case. In the second case I forgot to add the test for the fancier
menucompletion-stuff at that where the explanation strings are
displayed when no match was found (or the list not otherwise shown).
Bye
Sven
--- os/Zle/zle_tricky.c Wed Jun 9 11:24:34 1999
+++ Src/Zle/zle_tricky.c Wed Jun 9 16:31:53 1999
@@ -4368,10 +4368,10 @@
invalidatelist();
/* Print the explanation strings if needed. */
- if (!showinglist && validlist && nmatches != 1) {
+ if (!showinglist && validlist && usemenu != 2 && nmatches != 1) {
Cmgroup g = amatches;
Cexpl *e;
- int up = 0, tr = 1;
+ int up = 0, tr = 1, nn = 0;
if (!nmatches)
feep();
@@ -4384,7 +4384,12 @@
trashzle();
tr = 0;
}
+ if (nn) {
+ up++;
+ putc('\n', shout);
+ }
up += printfmt((*e)->str, (*e)->count, 1);
+ nn = 1;
}
e++;
}
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author