From 7bdb3b0bf8d5540c5736bb339ea9b623a3cab2e2 Mon Sep 17 00:00:00 2001 From: phillbush Date: Tue, 29 Dec 2020 22:45:49 -0300 Subject: [PATCH] rub out text when no item matches it --- xmenu.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/xmenu.c b/xmenu.c index 90e7906..f597aeb 100644 --- a/xmenu.c +++ b/xmenu.c @@ -1289,12 +1289,13 @@ enteritem: } else { append: if (append(text, buf, sizeof text, len)) { - currmenu->selected = matchitem(currmenu, text); - action = ACTION_DRAW; - } else { - select = NULL; - action = ACTION_SELECT | ACTION_DRAW; + if ((currmenu->selected = matchitem(currmenu, text))) { + action = ACTION_DRAW; + break; + } } + select = NULL; + action = ACTION_SELECT | ACTION_DRAW; break; } select = item;