diff --git a/dmenu.c b/dmenu.c index 5e13150..facf7f6 100644 --- a/dmenu.c +++ b/dmenu.c @@ -1248,7 +1248,14 @@ insert: break; case XK_Tab: #if PREFIXCOMPLETION_PATCH - if (!matches) break; /* cannot complete no matches */ + if (!matches) + break; /* cannot complete no matches */ + #if FUZZYMATCH_PATCH + /* only do tab completion if all matches start with prefix */ + for (item = matches; item && item->text; item = item->right) + if (item->text[0] != text[0]) + goto draw; + #endif // FUZZYMATCH_PATCH strncpy(text, matches->text, sizeof text - 1); text[sizeof text - 1] = '\0'; len = cursor = strlen(text); /* length of longest common prefix */