Commit Diff


commit - 35965938236f07dfd37f96ac2d6f809c2c4e8a3b
commit + 5977965a9835ff88ba6abfcd249f1f07a292db52
blob - f24ee9563c3abb2d9ad32ce41dfb5eb625a823b9
blob + 8203bdfacf79e6b373172854a84ea30803f2b611
--- minibuffer.c
+++ minibuffer.c
@@ -63,10 +63,15 @@ recompute_completions(int add)
 		l->type = LINE_COMPL;
 		if (add && l->flags & L_HIDDEN)
 			continue;
-		if (strcasestr(l->line, ministate.buf) != NULL)
+		if (strcasestr(l->line, ministate.buf) != NULL) {
+			if (l->flags & L_HIDDEN)
+				b->line_max++;
 			l->flags &= ~L_HIDDEN;
-		else
+		} else {
+			if (!(l->flags & L_HIDDEN))
+				b->line_max--;
 			l->flags |= L_HIDDEN;
+		}
 	}
 
 	if (b->current_line == NULL)