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

Re: pws-21: multiple -X in compadd



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