Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: Re: accept-and-menu-complete extra menu
- X-seq: zsh-workers 8215
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: PATCH: Re: accept-and-menu-complete extra menu
- Date: Tue, 12 Oct 1999 09:16:35 +0200 (MET DST)
- In-reply-to: Vin Shelton's message of 23 Sep 1999 22:35:18 -0400
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
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@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author