From: Gabriel Ivăncescu Subject: [PATCH v7 3/7] shell32/autocomplete: Don't auto-append on control characters, except for ^V (paste) Message-Id: <3237558a09fe91eaf697f646a10e80b05f0bd2eb.1537211843.git.gabrielopcode@gmail.com> Date: Mon, 17 Sep 2018 22:23:11 +0300 In-Reply-To: <1dbaca48b326c6a73fad704fe2eb00697b764585.1537211843.git.gabrielopcode@gmail.com> References: <1dbaca48b326c6a73fad704fe2eb00697b764585.1537211843.git.gabrielopcode@gmail.com> We must not auto-append on control characters, most notably Backspace, but also ^X (cut) and so on. An exception is ^V, which auto-appends on Windows, so this is needed to match Windows behavior (also needed when receiving the ^V message directly). Signed-off-by: Gabriel Ivăncescu --- dlls/shell32/autocomplete.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/shell32/autocomplete.c b/dlls/shell32/autocomplete.c index 183b37b..429b4fb 100644 --- a/dlls/shell32/autocomplete.c +++ b/dlls/shell32/autocomplete.c @@ -343,7 +343,8 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, case WM_CHAR: case WM_UNICHAR: ret = CallWindowProcW(This->wpOrigEditProc, hwnd, uMsg, wParam, lParam); - autocomplete_text(This, hwnd, (This->options & ACO_AUTOAPPEND) + autocomplete_text(This, hwnd, (This->options & ACO_AUTOAPPEND) && + (wParam >= ' ' || wParam == 0x16 /* ^V (paste) */) ? autoappend_flag_yes : autoappend_flag_no); return ret; case WM_DESTROY: -- 1.9.1