zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: bug fix for tricky.c
Date: Mon, 13 Sep 1999 11:03:30 +0200 (MET DST)	[thread overview]
Message-ID: <199909130903.LAA05525@beta.informatik.hu-berlin.de> (raw)


The completion code numbers patches. This was broken when multiple
groups were used.

Bye
 Sven

diff -u -r os/Zle/zle_tricky.c Src/Zle/zle_tricky.c
--- os/Zle/zle_tricky.c	Thu Sep  9 16:32:15 1999
+++ Src/Zle/zle_tricky.c	Sun Sep 12 21:35:38 1999
@@ -7184,11 +7192,8 @@
 	n->mcount = g->mcount;
 	n->matches = p = (Cmatch *) ncalloc((n->mcount + 1) *
 					    sizeof(Cmatch));
-	for (rn = 1, q = g->matches; *q; q++, p++, rn) {
+	for (q = g->matches; *q; q++, p++)
 	    *p = dupmatch(*q);
-	    (*p)->rnum = rn++;
-	    (*p)->gnum = mn++;
-	}
 	*p = NULL;
 
 	n->lcount = g->lcount;
@@ -7219,6 +7224,12 @@
 	    n->ccs = NULL;
 	g = g->next;
     }
+    for (g = amatches; g; g = g->next) {
+	for (rn = 1, q = g->matches; *q; q++) {
+	    (*q)->rnum = rn++;
+	    (*q)->gnum = mn++;
+	}
+    }
     pmatches = amatches;
     hasperm = 1;
     permmnum = mn - 1;
@@ -7289,6 +7300,7 @@
 	g = n;
     }
     hasperm = 0;
+    minfo.cur = NULL;
 }
 
 /* Insert the given string into the command line.  If move is non-zero, *
@@ -7950,7 +7967,7 @@
 	minfo.cur = NULL;
     } else {
 	if (oldlist) {
-	    if (oldins)
+	    if (oldins && minfo.cur)
 		acceptlast();
 	} else
 	    minfo.cur = NULL;
@@ -7967,11 +7984,9 @@
 	}
 	insmnum = comp_mod(insmnum, (minfo.group)->mcount);
     } else {
-	int c = 0;
-
 	insmnum = comp_mod(insmnum, permmnum);
 	for (minfo.group = amatches;
-	     minfo.group && (c += (minfo.group)->mcount) <= insmnum;
+	     minfo.group && (minfo.group)->mcount <= insmnum;
 	     minfo.group = (minfo.group)->next)
 	    insmnum -= (minfo.group)->mcount;
 	if (!minfo.group) {

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


                 reply	other threads:[~1999-09-13  9:03 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=199909130903.LAA05525@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).