about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/Zle/zle_tricky.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c
index 1d9466378..9756189d4 100644
--- a/Src/Zle/zle_tricky.c
+++ b/Src/Zle/zle_tricky.c
@@ -577,8 +577,17 @@ acceptlast(void)
 	zsfree(minfo.postbr);
 	minfo.postbr = ztrdup(lastpostbr);
 
-	if (listshown)
-	    showinglist = -2;
+	if (listshown && (lastprebr || lastpostbr)) {
+	    Cmgroup g;
+	    Cmatch *m;
+
+	    for (g = amatches, m = NULL; g && (!m || !*m); g = g->next)
+		for (m = g->matches; *m; m++)
+		    if (!hasbrpsfx(*m, minfo.prebr, minfo.postbr)) {
+			showinglist = -2;
+			break;
+		    }
+	}
     }
     menuacc++;