diff --git a/libs/arg.c b/libs/arg.c index ed2fd14..732a905 100644 --- a/libs/arg.c +++ b/libs/arg.c @@ -87,8 +87,22 @@ void moveup(Arg *arg) { } void complete(Arg *arg) { + int itc = 0; + struct item *item; + if (hideitem) return; + if (matchend) { + itc++; + + for (item = matchend; item && item->left; item = item->left) + itc++; + } + + if (!itc) { + return; + } + strncpy(tx.text, sel->nsgrtext, sizeof tx.text - 1); tx.text[sizeof tx.text - 1] = '\0'; sp.cursor = strlen(tx.text);