Addressing prefixcompletion vs fuzzymatch compatibility issue ref. #5

This commit is contained in:
bakkeby 2021-08-24 16:54:57 +02:00
parent 310bfe4e02
commit 328a60e0d3

View File

@ -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 */