summaryrefslogtreecommitdiff
path: root/Src/Zle/compcore.c
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 /Src/Zle/compcore.c
parent7a83e27a6e4e4dfb606160ef1a179563f977b5fd (diff)
downloadzsh-b5594215dd13afd833314e973358965f0cd7d60b.tar.gz
zsh-b5594215dd13afd833314e973358965f0cd7d60b.zip
make sure that completion messages are displayed even when there are no matches (11092)
Diffstat (limited to 'Src/Zle/compcore.c')
-rw-r--r--Src/Zle/compcore.c14
1 files changed, 13 insertions, 1 deletions
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). */