zsh-workers
 help / color / mirror / code / Atom feed
* Re: pws-21: multiple -X in compadd
@ 1999-06-09 14:36 Sven Wischnowsky
  0 siblings, 0 replies; 2+ messages in thread
From: Sven Wischnowsky @ 1999-06-09 14:36 UTC (permalink / raw)
  To: zsh-workers


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@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 2+ messages in thread

* pws-21: multiple -X in compadd
@ 1999-06-09 12:53 Andrej Borsenkow
  0 siblings, 0 replies; 2+ messages in thread
From: Andrej Borsenkow @ 1999-06-09 12:53 UTC (permalink / raw)
  To: ZSH workers mailing list

While testing something different ...

bor@itsrm2:~%> zsh -f
itsrm2% source /tools/share/zsh/functions/compinit
itsrm2% {
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

/andrej


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-06-09 14:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-06-09 14:36 pws-21: multiple -X in compadd Sven Wischnowsky
  -- strict thread matches above, loose matches on Subject: below --
1999-06-09 12:53 Andrej Borsenkow

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).