zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Cc: greg@klanderman.net (Greg Klanderman)
Subject: Re: extended compctl bug in 3.1.5
Date: Tue, 22 Jun 1999 15:31:15 +0200 (MET DST)	[thread overview]
Message-ID: <199906221331.PAA03789@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: greg@klanderman.net's message of Tue, 22 Jun 1999 09:21:47 -0400 (EDT)


Greg Klanderman wrote:

> Hi,
> 
> I hope this example will illustrate two bugs in using the "R" pattern
> in extended completion:
> 
> compctl -k '(foo bar)' -x 'R[bar,foo]' -k '(a b c)' \
>              - 'R[foo,;]' -k '(1 2 3)' -- foobar
> 
> First, type "foobar foo", with no space after "foo" and hit TAB.  You
> get a beep and no completions, because the 'R[foo,;]' clause is
> matching even though you are not after but ON the word with prefix
> 'foo'.  I would expect it to complete "foo" by appending the suffix
> space.

Yes, we should probably avoid this.

> Second, type "foobar foo bar ", with a space after "bar".  Hit TAB and
> you get the completions "a", "b", and "c", which you should not, as
> you are not before "foo".

This, however is intentional -- think about cases where you want to
have multiple groups of `foo ... bar'. But the manual could be
clearer...

I don't know if you can apply this patch to an unmodified 3.1.5.

Bye
 Sven

diff -u os/Zle/zle_tricky.c Src/Zle/zle_tricky.c
--- os/Zle/zle_tricky.c	Tue Jun 22 11:51:29 1999
+++ Src/Zle/zle_tricky.c	Tue Jun 22 15:24:27 1999
@@ -5631,7 +5631,7 @@
 		    case CCT_RANGEPAT:
 			if (cc->type == CCT_RANGEPAT)
 			    tokenize(sc = dupstring(cc->u.l.a[i]));
-			for (j = clwpos; j; j--) {
+			for (j = clwpos - 1; j > 0; j--) {
 			    untokenize(s = ztrdup(clwords[j]));
 			    if (cc->type == CCT_RANGESTR)
 				sc = rembslash(cc->u.l.a[i]);
diff -u od/Zsh/compctl.yo Doc/Zsh/compctl.yo
--- od/Zsh/compctl.yo	Tue Jun 22 11:51:38 1999
+++ Doc/Zsh/compctl.yo	Tue Jun 22 15:26:22 1999
@@ -633,7 +633,8 @@
 )
 item(tt(r[)var(str1)tt(,)var(str2)tt(])...)(
 Matches if the cursor is after a word with prefix var(str1).  If there
-is also a word with prefix var(str2) on the command line it matches
+is also a word with prefix var(str2) on the command line after the one 
+matched by var(str1) it matches
 only if the cursor is before this word. If the comma and var(str2) are
 omitted, it matches if the cursor is after a word with prefix var(str1).
 )

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


             reply	other threads:[~1999-06-22 13:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-06-22 13:31 Sven Wischnowsky [this message]
  -- strict thread matches above, loose matches on Subject: below --
1999-06-22 13:21 Greg Klanderman

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=199906221331.PAA03789@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=greg@klanderman.net \
    --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).