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:  Bad interaction between -iprefix and -string
Date: Thu, 11 Feb 1999 16:41:32 +0100 (MET)	[thread overview]
Message-ID: <199902111541.QAA06148@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Peter Stephenson's message of Thu, 11 Feb 1999 15:12:15 +0100


Peter Stephenson wrote:

> This came out of my attempts to handle dd, but here's a simpler test.
> The [[ ... ]] stuck on its own looks funny, but it relies on the side
> effect on IPREFIX.
> 
> % defcomp stest
> % which __stest
> __stest () {
>         if [[ -iprefix name= ]]
>         then
>                 [[ -string , ]]
>                 complist -k '(yan tan tethera dick)'
>         fi
> }
> % stest name=y<TAB>                # produces...
> % stest name=yan                   # OK so far, add `,te' by hand...
> % stest name=yan,te<TAB>           # produces...
> % stest name=yan,tedick            # The te is being ignored, too.

I forgot to ignore the already ignored prefix for this kind of
condition.

Stuff like the above makes me think that even more control over the
inserted suffixes would be nice. In this case: make a `,' fall in
place automatically.

Bye
 Sven

--- os/Zle/compctl.c	Tue Feb  9 09:22:04 1999
+++ Src/Zle/compctl.c	Thu Feb 11 16:36:41 1999
@@ -2025,7 +2025,7 @@
 {
     if (comp_check()) {
 	char *s;
-	int i;
+	int i, ipl;
 
 	if (a[1]) {
 	    s = cond_str(a, 1);
@@ -2038,9 +2038,9 @@
 	    zerr("zle not loaded, zle condition not available", NULL, 0);
 	    return 1;
 	}
-	i = getcpatptr(comp_strptr(NULL, NULL), i, s, id);
+	i = getcpatptr(comp_strptr(&ipl, NULL), i, s, id);
 	if (i != -1) {
-	    ignore_prefix(i);
+	    ignore_prefix(i - ipl);
 	    return 1;
 	}
     }

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


             reply	other threads:[~1999-02-11 15:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-02-11 15:41 Sven Wischnowsky [this message]
1999-02-11 16:34 Sven Wischnowsky

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=199902111541.QAA06148@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).