Module: wine
Branch: master
Commit: ce254b5f6d90ea23b57cf865f526b27d83f36115
URL: https://source.winehq.org/git/wine.git/?a=commit;h=ce254b5f6d90ea23b57cf865…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com>
Date: Sat Sep 22 17:53:42 2018 +0300
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(a)gmail.com>
Signed-off-by: Huw Davies <huw(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
dlls/shell32/autocomplete.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/dlls/shell32/autocomplete.c b/dlls/shell32/autocomplete.c
index ef835b9..048a47f 100644
--- a/dlls/shell32/autocomplete.c
+++ b/dlls/shell32/autocomplete.c
@@ -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);