zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: Re: completion with multiple arguments for an option.
Date: Fri, 5 May 2000 09:36:10 +0200 (MET DST)	[thread overview]
Message-ID: <200005050736.JAA22599@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Tanaka Akira's message of 05 May 2000 02:54:37 +0900


Tanaka Akira wrote:

> Z(4):akr@serein% Src/zsh -f
> serein% bindkey -e; autoload -U compinit; compinit -D
> serein% _tst () { _arguments '-o:1:(a):2:(b)' }
> serein% compdef _tst tst
> serein% tst -o <TAB>
> a   b
> 
> It shouldn't complete `b'.

Yep. The patch looks bigger than it is.

Bye
 Sven

Index: Src/Zle/computil.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/computil.c,v
retrieving revision 1.12
diff -u -r1.12 computil.c
--- Src/Zle/computil.c	2000/05/03 14:44:01	1.12
+++ Src/Zle/computil.c	2000/05/05 07:35:20
@@ -1438,21 +1438,27 @@
 	if (single)
 	    break;
 
-	if (!opt && arg->num >= 0 && !arg->next && miss)
-	    arg = ca_laststate.d->rest;
-	else {
-	    onum = arg->num;
-	    rest = (onum != arg->min && onum == ca_laststate.nth);
-	    if ((arg = arg->next)) {
-		if (arg->num != onum + 1)
-		    miss = 1;
-	    } else if (rest || (oopt > 0 && !opt)) {
+	if (!opt) {
+	    if (arg->num >= 0 && !arg->next && miss)
 		arg = ca_laststate.d->rest;
-		oopt = -1;
+	    else {
+		onum = arg->num;
+		rest = (onum != arg->min && onum == ca_laststate.nth);
+		if ((arg = arg->next)) {
+		    if (arg->num != onum + 1)
+			miss = 1;
+		} else if (rest || (oopt > 0 && !opt)) {
+		    arg = ca_laststate.d->rest;
+		    oopt = -1;
+		}
 	    }
+	} else {
+	    if (!lopt)
+		break;
+	    arg = arg->next;
 	}
     }
-    if (!single && opt && lopt) {
+    if (!single && opt && (lopt || ca_laststate.oopt)) {
 	opt = NULL;
 	arg = ca_get_arg(ca_laststate.d, ca_laststate.nth);
 

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


                 reply	other threads:[~2000-05-05  7:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200005050736.JAA22599@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).