about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-09-09 08:30:25 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-09-09 08:30:25 +0000
commit774a57ae1451070564a76c85f179d7a3f847b7ca (patch)
tree7aef68628522b48e86bf5fc0b80498b56dd3b7c9 /Src
parent3a544165456a0cb16d36bc0c7b19d7d787c890d9 (diff)
downloadzsh-774a57ae1451070564a76c85f179d7a3f847b7ca.tar.gz
zsh-774a57ae1451070564a76c85f179d7a3f847b7ca.tar.xz
zsh-774a57ae1451070564a76c85f179d7a3f847b7ca.zip
zsh-workers/7734
Diffstat (limited to 'Src')
-rw-r--r--Src/Zle/complist.c2
-rw-r--r--Src/Zle/zle_tricky.c38
2 files changed, 26 insertions, 14 deletions
diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c
index 8bd66a407..a1835655d 100644
--- a/Src/Zle/complist.c
+++ b/Src/Zle/complist.c
@@ -344,7 +344,7 @@ complistmatches(Hookdef dummy, Chdata dat)
 		nl = !!strchr(*pp++, '\n');
 
 	    pp = g->ylist;
-	    if (nl) {
+	    if (nl || !pp[1]) {
 		/* Yup, there are newlines, count lines. */
 		char *nlptr, *sptr;
 
diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c
index 357e248b3..b3a54bf59 100644
--- a/Src/Zle/zle_tricky.c
+++ b/Src/Zle/zle_tricky.c
@@ -4031,8 +4031,6 @@ addmatches(Cadata dat, char **argv)
 	    }
 	    compnmatches = mnum;
 	    compnnmatches = nmnum;
-	    if (dat->exp)
-		addexpl();
 	    if (dat->apar)
 		set_param(dat->apar, aparl);
 	    if (dat->opar)
@@ -4040,9 +4038,19 @@ addmatches(Cadata dat, char **argv)
 	    if (dat->dpar)
 		set_param(dat->dpar, dparl);
 	    if (dat->ylist) {
-		endcmgroup(get_user_var(dat->ylist));
-		begcmgroup("default", 0);
-	    }
+		if (dat->group) {
+		    endcmgroup(get_user_var(dat->ylist));
+		    begcmgroup(dat->group, (dat->aflags & CAF_NOSORT));
+		    if (dat->exp)
+			addexpl();
+		} else {
+		    if (dat->exp)
+			addexpl();
+		    endcmgroup(get_user_var(dat->ylist));
+		    begcmgroup("default", 0);
+		}
+	    } else if (dat->exp)
+		addexpl();
 	} LASTALLOC;
     } SWITCHBACKHEAPS;
 
@@ -6724,7 +6732,8 @@ makecomplistflags(Compctl cc, char *s, int incmd, int compadd)
 	    incompctlfunc = 0;
 	    uv = "reply";
 	}
-	
+	if (uv)
+	    yaptr = get_user_var(uv);
 	if ((tt = cc->explain)) {
 	    tt = dupstring(tt);
 	    if ((cc->mask & CC_EXPANDEXPL) && !parsestr(tt)) {
@@ -6732,13 +6741,16 @@ makecomplistflags(Compctl cc, char *s, int incmd, int compadd)
 		untokenize(tt);
 	    }
 	    expl->str = tt;
-	    addexpl();
+	    if (cc->gname) {
+		endcmgroup(yaptr);
+		begcmgroup(cc->gname, cc->mask2 & CC_NOSORT);
+		addexpl();
+	    } else {
+		addexpl();
+		endcmgroup(yaptr);
+		begcmgroup("default", 0);
+	    }
 	}
-	if (uv && (yaptr = get_user_var(uv)))
-	    endcmgroup(yaptr);
-	else
-	    endcmgroup(NULL);
-	begcmgroup("default", 0);
     } else if ((tt = cc->explain)) {
 	tt = dupstring(tt);
 	if ((cc->mask & CC_EXPANDEXPL) && !parsestr(tt)) {
@@ -8135,7 +8147,7 @@ ilistmatches(Hookdef dummy, Chdata dat)
 		nl = !!strchr(*pp++, '\n');
 
 	    pp = g->ylist;
-	    if (nl) {
+	    if (nl || !pp[1]) {
 		/* Yup, there are newlines, count lines. */
 		char *nlptr, *sptr;