about summary refs log tree commit diff
path: root/Src/Zle/compcore.c
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-05-31 09:56:12 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-05-31 09:56:12 +0000
commit5a4253f42edc9258a9a5bad59b0fa2a7b4a46d50 (patch)
tree1c6cc1e77f12396acd87e448e777fbb5a143b03f /Src/Zle/compcore.c
parentfd25b24df6b4f098944c4994195d3894a27a8208 (diff)
downloadzsh-5a4253f42edc9258a9a5bad59b0fa2a7b4a46d50.tar.gz
zsh-5a4253f42edc9258a9a5bad59b0fa2a7b4a46d50.tar.xz
zsh-5a4253f42edc9258a9a5bad59b0fa2a7b4a46d50.zip
allow display of only messages via $compstate[list]=messages (11688)
Diffstat (limited to 'Src/Zle/compcore.c')
-rw-r--r--Src/Zle/compcore.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c
index 1a18f14e3..ded5c3b31 100644
--- a/Src/Zle/compcore.c
+++ b/Src/Zle/compcore.c
@@ -440,7 +440,7 @@ do_completion(Hookdef dummy, Compldat dat)
     if (!showinglist && validlist && usemenu != 2 && 
 	(nmatches != 1 || diffmatches) &&
 	useline >= 0 && useline != 2 && (!oldlist || !listshown)) {
-	onlyexpl = 1;
+	onlyexpl = 3;
 	showinglist = -2;
     }
  compend:
@@ -802,7 +802,8 @@ callcompfunc(char *s, char *fn)
 	else
 	    uselist = 0;
 	forcelist = (complist && strstr(complist, "force"));
-	onlyexpl = (complist && strstr(complist, "expl"));
+	onlyexpl = (complist ? ((strstr(complist, "expl") ? 1 : 0) |
+				(strstr(complist, "messages") ? 2 : 0)) : 0);
 
 	if (!compinsert)
 	    useline = 0;
@@ -2449,7 +2450,7 @@ addexpl(void)
 
     for (n = firstnode(expls); n; incnode(n)) {
 	e = (Cexpl) getdata(n);
-	if (!strcmp(curexpl->str, e->str)) {
+	if (e->count >= 0 && !strcmp(curexpl->str, e->str)) {
 	    e->count += curexpl->count;
 	    e->fcount += curexpl->fcount;
 
@@ -2471,11 +2472,11 @@ addmesg(char *mesg)
 
     for (n = firstnode(expls); n; incnode(n)) {
 	e = (Cexpl) getdata(n);
-	if (!strcmp(mesg, e->str))
+	if (e->count < 0 && !strcmp(mesg, e->str))
 	    return;
     }
     e = (Cexpl) zhalloc(sizeof(*e));
-    e->count = e->fcount = 1;
+    e->count = e->fcount = -1;
     e->str = dupstring(mesg);
     addlinknode(expls, e);
     newmatches = 1;