Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com ---
This matches Windows behavior and gets rid of annoying caret movement.
dlls/shell32/autocomplete.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/dlls/shell32/autocomplete.c b/dlls/shell32/autocomplete.c index 449e8a4..9bc617b 100644 --- a/dlls/shell32/autocomplete.c +++ b/dlls/shell32/autocomplete.c @@ -308,7 +308,13 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, break;
if (!strncmpiW(hwndText, strs, len)) { - if (cpt == 0 && noautoappend == FALSE) + DWORD sel_start; + + /* Don't auto-append unless the caret is at the end */ + if (cpt == 0 && noautoappend == FALSE + && (CallWindowProcW(edit_proc, hwnd, EM_GETSEL, (WPARAM)&sel_start, 0), + sel_start == len) + ) { /* The character capitalization can be different, so merge hwndText and strs into a new string */