From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7986 invoked from network); 3 Mar 1999 10:54:12 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 3 Mar 1999 10:54:12 -0000 Received: (qmail 5408 invoked by alias); 3 Mar 1999 10:53:29 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5620 Received: (qmail 5380 invoked from network); 3 Mar 1999 10:53:27 -0000 Date: Wed, 3 Mar 1999 11:52:38 +0100 (MET) Message-Id: <199903031052.LAA21140@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: "Kiddle, Oliver"'s message of Tue, 2 Mar 1999 17:11:11 -0000 Subject: Re: A couple of bugs (Having had trouble sending this to the list, Oliver sent me this directly...) Kiddle, Oliver wrote: > Completion in braces doesn't work properly with directories: > > zsh -f > ls /usr/local/{bin > > Results in: > ls /usr/local/{{bin/ > The first tab adds the slash. The second, which I would expect to list > files in /usr/local/bin inserts a second brace. I also get strange > results from > ls /usr/local/{bin/, > > I noticed the following effect of completion matching in pws-10 which > looks like a bug to me: Fixed by the patch below. > zsh -f > setopt EXTENDED_GLOB GLOB_COMPLETE > cd~opk > > That results in a beep, as I would expect. Now if I continue: > > compctl -M 'm:{a-z}={A-Z}' > cd~opk > > I now get > cd _ > where the underscore is the cursor. Here I think, the second behaviour is the correct one, because `cd~opk' is (with extendedglob) a valid pattern, meaning: match `cd' unless it also matches `opk'. Since `cd' only seldom looks like `opk' this is the same as saying `cd'. Right? So the first case should be changed to behave the same as the second one. Btw. I'd like to express my thankfulness to all of you who send me bug reports for the completion code (or sugegstions for the new stuff, or...), it's so complicated that I just can't test everything. Thanks. And sorry that there are so many bugs. Bye Sven diff -u os/Zle/zle_tricky.c Src/Zle/zle_tricky.c --- os/Zle/zle_tricky.c Wed Mar 3 09:03:29 1999 +++ Src/Zle/zle_tricky.c Wed Mar 3 11:42:55 1999 @@ -4489,7 +4489,7 @@ (((addwhat & CC_DISCMDS) && (hn->flags & DISABLED)) || ((addwhat & CC_EXCMDS) && !(hn->flags & DISABLED)))) || ((addwhat & CC_BINDINGS) && !(hn->flags & DISABLED))))) { - if (sl >= rpl + rsl || mstack) { + if (sl >= rpl + rsl || mstack || cp) { if (cp) { test = domatch(s, patcomp, 0); e = s + sl; @@ -6145,6 +6145,8 @@ line[cs] = 0; lppre = dupstring((char *) (line + wb)); line[cs] = save; + if (brbeg && *brbeg) + strcpy(lppre + brpl, lppre + brpl + strlen(brbeg)); if ((p = strrchr(lppre, '/'))) { p[1] = '\0'; lppl = strlen(lppre); @@ -6161,8 +6163,14 @@ char save = line[we]; line[we] = 0; - lpsuf = strchr(dupstring((char *) (line + cs)), '/'); + lpsuf = dupstring((char *) (line + cs)); line[we] = save; + if (brend && *brend) { + char *p = lpsuf + brsl - (cs - wb); + + strcpy(p, p + strlen(brend)); + } + lpsuf = strchr(lpsuf, '/'); lpsl = (lpsuf ? strlen(lpsuf) : 0); } else { -- Sven Wischnowsky wischnow@informatik.hu-berlin.de