dynamic options vs fuzzymatch and prefix completion patches fix ref. #8

This commit is contained in:
bakkeby 2022-01-20 13:53:38 +01:00
parent e3a291ea43
commit ea2fd892db
2 changed files with 10 additions and 1 deletions

View File

@ -57,6 +57,11 @@ readstream(FILE* stream)
imax = i;
}
}
/* If the command did not give any output at all, then do not clear the existing items */
if (!i)
return;
if (items)
items[i].text = NULL;
#if PANGO_PATCH
@ -66,4 +71,8 @@ readstream(FILE* stream)
#endif // PANGO_PATCH
if (!dynamic || !*dynamic)
lines = MIN(lines, i);
else {
text[0] = '\0';
cursor = 0;
}
}

View File

@ -36,7 +36,7 @@ fuzzymatch(void)
for (i = 0; i < itext_len && (c = it->text[i]); i++) {
/* fuzzy match pattern */
if (!fstrncmp(&text[pidx], &c, 1)) {
if(sidx == -1)
if (sidx == -1)
sidx = i;
pidx++;
if (pidx == text_len) {