* PATCH: Re: accept-and-menu-complete extra menu
@ 1999-10-12 7:16 Sven Wischnowsky
0 siblings, 0 replies; only message in thread
From: Sven Wischnowsky @ 1999-10-12 7:16 UTC (permalink / raw)
To: zsh-workers
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1999-10-12 7:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-10-12 7:16 PATCH: Re: accept-and-menu-complete extra menu Sven Wischnowsky
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).