Fix tab completion when no matches
This commit is contained in:
parent
c8e0d08302
commit
9201b3ba18
14
libs/arg.c
14
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);
|
||||
|
|
Loading…
Reference in a new issue