about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-05-03 08:35:33 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-05-03 08:35:33 +0000
commitb5594215dd13afd833314e973358965f0cd7d60b (patch)
treeb684a861fd98d37e861a1c3a6eb45cf73bf9add7
parent7a83e27a6e4e4dfb606160ef1a179563f977b5fd (diff)
downloadzsh-b5594215dd13afd833314e973358965f0cd7d60b.tar.gz
zsh-b5594215dd13afd833314e973358965f0cd7d60b.tar.xz
zsh-b5594215dd13afd833314e973358965f0cd7d60b.zip
make sure that completion messages are displayed even when there are no matches (11092)
-rw-r--r--ChangeLog4
-rw-r--r--Completion/Base/_arguments2
-rw-r--r--Src/Zle/compcore.c14
3 files changed, 18 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 7089f88d7..5abf8301b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2000-05-03  Sven Wischnowsky  <wischnow@informatik.hu-berlin.de>
 
+	* 11092: Completion/Base/_arguments, Src/Zle/compcore.c: make sure
+ 	that completion messages are displayed even when there are no
+ 	matches
+	
 	* 11091: Functions/Zftp/zfcd_match: fix for completion of
  	directories for zftp suite
 	
diff --git a/Completion/Base/_arguments b/Completion/Base/_arguments
index 38002ccf6..cab1f778a 100644
--- a/Completion/Base/_arguments
+++ b/Completion/Base/_arguments
@@ -363,7 +363,7 @@ if (( $# )) && comparguments "$multi[@]" "$autod" "$@"; then
 
   [[ -n "$mesg" ]] && _message "$mesg"
   if [[ -n "$noargs" ]]; then
-    [[ -z "$ismulti" ]] && _message "$noargs"
+    [[ -z "$ismulti" && nm -eq "$compstate[nmatches]" ]] && _message "$noargs"
   else
     has_args=yes
   fi
diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c
index 44ec8ef6a..eeea42a4d 100644
--- a/Src/Zle/compcore.c
+++ b/Src/Zle/compcore.c
@@ -152,6 +152,11 @@ mod_export int nmatches;
 /**/
 mod_export int smatches;
 
+/* The number of messages. */
+
+/**/
+mod_export int nmessages;
+
 /* != 0 if only explanation strings should be printed */
 
 /**/
@@ -312,6 +317,7 @@ do_completion(Hookdef dummy, Compldat dat)
     minmlen = 1000000;
     maxmlen = -1;
     compignored = 0;
+    nmessages = 0;
 
     /* Make sure we have the completion list and compctl. */
     if (makecomplist(s, incmd, lst)) {
@@ -401,6 +407,11 @@ do_completion(Hookdef dummy, Compldat dat)
 		    clearlist = 1;
 	    } else
 		invalidatelist();
+	} else if (nmessages && forcelist) {
+	    if (uselist)
+		showinglist = -2;
+	    else
+		clearlist = 1;
 	}
     } else {
 	invalidatelist();
@@ -921,7 +932,7 @@ makecomplist(char *s, int incmd, int lst)
 	hasperm = 0;
 	hasoldlist = 1;
 
-	if (nmatches && !errflag) {
+	if ((nmatches || nmessages) && !errflag) {
 	    validlist = 1;
 
 	    redup(osi, 0);
@@ -2390,6 +2401,7 @@ addmesg(char *mesg)
     addlinknode(expls, e);
     newmatches = 1;
     mgroup->new = 1;
+    nmessages++;
 }
 
 /* The comparison function for matches (used for sorting). */