shell32/autocomplete: Don't auto-append unless the caret is at the end.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Gabriel Ivăncescu 2018-09-27 00:35:22 +03:00 committed by Alexandre Julliard
parent d8de5fe47d
commit 3f31afafc3
1 changed files with 6 additions and 0 deletions

View File

@ -136,9 +136,15 @@ static size_t format_quick_complete(WCHAR *dst, const WCHAR *qc, const WCHAR *st
static void autoappend_str(IAutoCompleteImpl *ac, WCHAR *text, UINT len, WCHAR *str, HWND hwnd)
{
DWORD sel_start;
WCHAR *tmp;
size_t size;
/* Don't auto-append unless the caret is at the end */
SendMessageW(hwnd, EM_GETSEL, (WPARAM)&sel_start, 0);
if (sel_start != len)
return;
/* The character capitalization can be different,
so merge text and str into a new string */
size = len + strlenW(&str[len]) + 1;