summary refs log tree commit diff
path: root/menu.c
diff options
context:
space:
mode:
authorokan <okan>2017-04-25 12:08:05 +0000
committerokan <okan>2017-04-25 12:08:05 +0000
commit717e6c8167978bef3ffaba49322724e72cb78ba3 (patch)
tree3ee5f196bc1da1b4264fd00976e17a6792bd3b8a /menu.c
parentffcfff3dea48485f806670b1d34b7a6db1363c8d (diff)
downloadcwm-717e6c8167978bef3ffaba49322724e72cb78ba3.tar.gz
cwm-717e6c8167978bef3ffaba49322724e72cb78ba3.tar.xz
cwm-717e6c8167978bef3ffaba49322724e72cb78ba3.zip
Remove 'noresult' (and simplify) as it does nothing and makes the logic around
it needless. History doesn't show what this might have been used for in future
iterations.
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/menu.c b/menu.c
index ea5b2dd..b2658d7 100644
--- a/menu.c
+++ b/menu.c
@@ -52,7 +52,6 @@ struct menu_ctx {
 	int			 list;
 	int			 listing;
 	int			 changed;
-	int			 noresult;
 	int			 prev;
 	int			 entry;
 	int			 num;
@@ -313,15 +312,10 @@ menu_handle_key(XEvent *e, struct menu_ctx *mc, struct menu_q *menuq,
 		(void)strlcat(mc->searchstr, chr, sizeof(mc->searchstr));
 	}
 
-	mc->noresult = 0;
-	if (mc->changed && mc->searchstr[0] != '\0') {
-		(*mc->match)(menuq, resultq, mc->searchstr);
-		/* If menuq is empty, never show we've failed */
-		mc->noresult = TAILQ_EMPTY(resultq) && !TAILQ_EMPTY(menuq);
-	} else if (mc->changed)
-		TAILQ_INIT(resultq);
-
-	if (!mc->list && mc->listing && !mc->changed) {
+	if (mc->changed) {
+		if (mc->searchstr[0] != '\0')
+			(*mc->match)(menuq, resultq, mc->searchstr);
+	} else if (!mc->list && mc->listing) {
 		TAILQ_INIT(resultq);
 		mc->listing = 0;
 	}