Fix tab completion when no matches

This commit is contained in:
speedie 2023-07-05 02:02:35 +02:00
parent c8e0d08302
commit 9201b3ba18

View file

@ -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);