eric pouech (@epo) commented about programs/cmd/lineedit.c:
/* curPos is often numRead - 1, but not always, as in the case where history is retrieved
* and then user backspaces to somewhere mid-string and then hits Tab.
*/
TRACE("numRead: %lu, curPos: %u\n", *numRead, curPos);
switch (inputBuffer[curPos]) {
case L'\t':
TRACE("TAB: [%s]\n", wine_dbgstr_w(inputBuffer));
inputBuffer[curPos] = L'\0';
len = curPos;
sc.haveSearchResult = FALSE;
/* See if we need to reset an existing search. */
if (sc.hSearch != INVALID_HANDLE_VALUE) {
/* If tab key was hit at a different location than last time */
if (curPos != oldCurPos) {
that's not sufficient, you have also to compare that inputbuffer up to current pos hasn't changed since previous call
(eg directory with za, za2 and zb zb2 files... circle twice from "za", replace "za" by "zb" and circle with tab...)