shell32/autocomplete: Don't autocomplete at all on most control characters.

Most control characters sent via some CTRL+key combination should not
autocomplete at all. ^C is one example, where just copying some text should
not show the auto-suggestion box (if not visible). ^V is another example,
where it is already handled in WM_PASTE, so it has to be a no-op here,
else auto-append from WM_PASTE would complete the text and then the ^V
autocompletion would remove every other suggestion in the listbox.

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-22 17:53:42 +03:00 committed by Alexandre Julliard
parent f1be5c7861
commit ce254b5f6d
1 changed files with 4 additions and 0 deletions

View File

@ -359,6 +359,10 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam,
return ACEditSubclassProc_KeyDown(This, hwnd, uMsg, wParam, lParam);
case WM_CHAR:
case WM_UNICHAR:
/* Don't autocomplete at all on most control characters */
if (iscntrlW(wParam) && !(wParam >= '\b' && wParam <= '\r'))
break;
ret = CallWindowProcW(This->wpOrigEditProc, hwnd, uMsg, wParam, lParam);
autocomplete_text(This, hwnd, (This->options & ACO_AUTOAPPEND) && wParam >= ' '
? autoappend_flag_yes : autoappend_flag_no);