eric pouech (@epo) commented about programs/cmd/lineedit.c:
} else {
cc = len;
while (cc > 0 && inputBuffer[cc] != L' ' && inputBuffer[cc] != L'\t') {
cc--;
}
}
- }
- if (cc != sc->searchPos || inputBuffer[sc->searchPos] == L'\') {
cc++;
- }
- sc->insertPos = cc;
+}
+static void FindNextMatchingDirectoryEntry(const WCHAR *searchstr, PSEARCH_CONTEXT sc)
a couple of comments here:
* actually, this is not exactly how native (Win10) behaves: native captures the list of matching files at first tab usage, and doesn't update that list if eg. a file matching the pattern is added * the way done here is a bit more dynamic (as it would capture file creation/deletion), and I don't think it matters much from a user perspective
the main thing I'm concerned about is that code to handle backwards shift-tab will be a bit more painful, and also the restart case (when the matched file is deleted)
I think code would be simpler and more readable when storing the list of files, but I won't block on that. I let you pick up your favorite one.
if you keep current logic, it seems to me that:
* ->hadOneMatch is only used locally, and should rather be a local variable * ->hasSearchResult would make more sense be return value from this function