From: Gabriel Ivăncescu Subject: [PATCH v3 1/5] shell32/autocomplete: Don't autocomplete at all on most control characters Message-Id: Date: Sat, 22 Sep 2018 17:53:42 +0300 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 --- v3: Use iscntrlW 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); -- 1.9.1