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: accept-and-menu-complete extra menu
Date: Tue, 12 Oct 1999 09:16:35 +0200 (MET DST)	[thread overview]
Message-ID: <199910120716.JAA04048@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Vin Shelton's message of 23 Sep 1999 22:35:18 -0400


Vin Shelton wrote:

> In pws-5 with (I think) all the patches applied, I'm seeing an extra
> menu on accept-and-menu-complete with old-style completion.
> 
>     zsh -f
>     zion% bindkey '^X\t' accept-and-menu-complete
>     zion% setopt noalwayslastprompt
>     zion% echo $ZSH_<TAB>
>     ZSH_NAME     ZSH_VERSION
> 
> pressing another TAB gives me:
>     zion% echo $ZSH_NAME                ; and then ^X-TAB yields:
>     zion% echo $ZSH_NAME $ZSH_VERSION
>     ZSH_NAME     ZSH_VERSION
>     zion% echo $ZSH_NAME $ZSH_VERSION
> 
> So, another menu appears when it shouldn't.
> 
> This was working fine in plain old pws-5, I believe.

It was. This was caused by an incomplete test in the code that makes
sure that a-a-m-c with completion inside braces allows only those
matches that match the prefix/suffix before/after the brace. In that
case the list of completions really changes and I wanted to make it
re-displayed. Which it did. Unfortunately it also re-displayed the
list when no matches were `removed' or there weren't even any braces.

Bye
 Sven

diff -u os/Zle/zle_tricky.c Src/Zle/zle_tricky.c
--- os/Zle/zle_tricky.c	Mon Oct 11 19:55:18 1999
+++ Src/Zle/zle_tricky.c	Mon Oct 11 20:03:02 1999
@@ -577,8 +577,17 @@
 	zsfree(minfo.postbr);
 	minfo.postbr = ztrdup(lastpostbr);
 
-	if (listshown)
-	    showinglist = -2;
+	if (listshown && (lastprebr || lastpostbr)) {
+	    Cmgroup g;
+	    Cmatch *m;
+
+	    for (g = amatches, m = NULL; g && (!m || !*m); g = g->next)
+		for (m = g->matches; *m; m++)
+		    if (!hasbrpsfx(*m, minfo.prebr, minfo.postbr)) {
+			showinglist = -2;
+			break;
+		    }
+	}
     }
     menuacc++;
 

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


                 reply	other threads:[~1999-10-12  7:16 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=199910120716.JAA04048@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).