zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: tricky.c and completion functions
Date: Tue, 17 Aug 1999 10:20:25 +0200 (MET DST)	[thread overview]
Message-ID: <199908170820.KAA08758@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Sven Wischnowsky's message of Fri, 13 Aug 1999 14:16:25 +0200 (MET DST)


I wrote:

> There was a bug with matching control (it didn't compare the strings
> for the anchors on the line and in the word).

Here is a fix for another bug: if you have `-M "r:|[-.]=*"' and the
matches `a-b.c' and `a.c' doing `a.<TAB>' removed the dot because it
didn't look ahead for matching anchors in both strings (only in one).

Bye
 Sven

diff -u os/Zle/zle_tricky.c Src/Zle/zle_tricky.c
--- os/Zle/zle_tricky.c	Fri Aug 13 14:16:37 1999
+++ Src/Zle/zle_tricky.c	Tue Aug 17 10:15:46 1999
@@ -2147,7 +2147,7 @@
 	wl = m->llen; w = l;
     }
     if (wl) {
-	/* Probably resie the buffer. */
+	/* Probably resize the buffer. */
 	if (matchbuflen - matchbufadded <= wl) {
 	    int blen = matchbuflen + wl + 20;
 	    char *buf;
@@ -3458,21 +3458,35 @@
 		for (t = n; (tn = t->next) && !cmp_anchors(o, tn, 1); t = tn);
 
 		if (tn) {
-		    Cline t;
-
 		    t = tn->prefix; tn->prefix = n->prefix; n->prefix = t;
 		    t = tn->suffix; tn->suffix = n->suffix; n->suffix = t;
 		    n = tn;
+		    o->flags |= CLF_MISS;
 		    continue;
 		} else {
-		    if (o->flags & CLF_SUF)
-			break;
+		    for (t = o; (tn = t->next) && !cmp_anchors(n, tn, 1);
+			 t = tn);
 
-		    o->word = o->line = o->orig = NULL;
-		    o->wlen = 0;
-		    free_cline(o->next);
-		    o->next = NULL;
-		    o->flags |= CLF_MISS;
+		    if (tn) {
+			t = tn->prefix; tn->prefix = o->prefix; o->prefix = t;
+			t = tn->suffix; tn->suffix = o->suffix; o->suffix = t;
+			if (po)
+			    po->next = tn;
+			else
+			    oo = tn;
+			o = tn;
+			o->flags |= CLF_MISS;
+			continue;
+		    } else {
+			if (o->flags & CLF_SUF)
+			    break;
+
+			o->word = o->line = o->orig = NULL;
+			o->wlen = 0;
+			free_cline(o->next);
+			o->next = NULL;
+			o->flags |= CLF_MISS;
+		    }
 		}
 	    }
 	    /* Ok, they are equal, now join the sub-lists. */

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


             reply	other threads:[~1999-08-17  8:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-08-17  8:20 Sven Wischnowsky [this message]
  -- strict thread matches above, loose matches on Subject: below --
1999-08-17  8:10 Sven Wischnowsky
1999-08-13 12:16 Sven Wischnowsky
1999-08-13 15:14 ` Tanaka Akira
1999-08-13 15:55   ` Bart Schaefer
1999-08-13 16:07     ` Tanaka Akira

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=199908170820.KAA08758@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).