zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: pws-21: multiple -X in compadd
Date: Wed, 9 Jun 1999 16:36:02 +0200 (MET DST)	[thread overview]
Message-ID: <199906091436.QAA21936@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: "Andrej Borsenkow"'s message of Wed, 9 Jun 1999 16:53:38 +0400


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


             reply	other threads:[~1999-06-09 14:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-06-09 14:36 Sven Wischnowsky [this message]
  -- strict thread matches above, loose matches on Subject: below --
1999-06-09 12:53 Andrej Borsenkow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199906091436.QAA21936@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).