summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--Src/Zle/complist.c6
-rw-r--r--Src/Zle/compresult.c17
3 files changed, 22 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 14cc2d4a6..944590380 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2000-04-25  Sven Wischnowsky  <wischnow@informatik.hu-berlin.de>
 
+	* 10917: Src/Zle/complist.c, Src/Zle/compresult.c: don't show
+ 	empty hidden matches even in menu-selection
+	
 	* 10916: Completion/Core/_main_complete, Src/Zle/complist.c:
  	re-calculate number of line with mark when needed; make default
  	prompts more consistent
diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c
index d0dd90bec..045517a6d 100644
--- a/Src/Zle/complist.c
+++ b/Src/Zle/complist.c
@@ -1589,6 +1589,12 @@ domenuselect(Hookdef dummy, Chdata dat)
     fdat = dat;
     selectlocalmap(mskeymap);
     noselect = 0;
+    while ((menuacc &&
+	    !hasbrpsfx(*(minfo.cur), minfo.prebr, minfo.postbr)) ||
+	   (((*minfo.cur)->flags & (CMF_NOLIST | CMF_MULT)) &&
+	    (!(*minfo.cur)->str || !*(*minfo.cur)->str)))
+	do_menucmp(0);
+
     mselect = (*(minfo.cur))->gnum;
     mline = 0;
     mlines = 999999;
diff --git a/Src/Zle/compresult.c b/Src/Zle/compresult.c
index 8c09a9491..f40ee6724 100644
--- a/Src/Zle/compresult.c
+++ b/Src/Zle/compresult.c
@@ -951,8 +951,10 @@ do_menucmp(int lst)
 	    } while (!(minfo.group)->mcount);
 	    minfo.cur = minfo.group->matches;
 	}
-    } while (menuacc &&
-	     !hasbrpsfx(*(minfo.cur), minfo.prebr, minfo.postbr));
+    } while ((menuacc &&
+	      !hasbrpsfx(*(minfo.cur), minfo.prebr, minfo.postbr)) ||
+	     (((*minfo.cur)->flags & (CMF_NOLIST | CMF_MULT)) &&
+	      (!(*minfo.cur)->str || !*(*minfo.cur)->str)));
     /* ... and insert it into the command line. */
     metafy_line();
     do_single(*(minfo.cur));
@@ -972,8 +974,10 @@ reverse_menu(Hookdef dummy, void *dummy2)
 	    minfo.cur = (minfo.group)->matches + (minfo.group)->mcount - 1;
 	} else
 	    minfo.cur--;
-    } while (menuacc &&
-	     !hasbrpsfx(*(minfo.cur), minfo.prebr, minfo.postbr));
+    } while ((menuacc &&
+	      !hasbrpsfx(*(minfo.cur), minfo.prebr, minfo.postbr)) ||
+	     (((*minfo.cur)->flags & (CMF_NOLIST | CMF_MULT)) &&
+	      (!(*minfo.cur)->str || !*(*minfo.cur)->str)));
     metafy_line();
     do_single(*(minfo.cur));
     unmetafy_line();
@@ -1244,6 +1248,11 @@ calclist(int showall)
 		    if (!(m->flags & CMF_ROWS))
 			g->flags &= ~CGF_ROWS;
 		} else if (showall || !(m->flags & (CMF_NOLIST | CMF_MULT))) {
+		    if ((m->flags & (CMF_NOLIST | CMF_MULT)) &&
+			(!m->str || !*m->str)) {
+			m->flags |= CMF_HIDE;
+			continue;
+		    }
 		    l = niceztrlen(m->str);
 		    ndisp++;
 		    if (l > glong)