[PATCH v3 1/5] shell32/autocomplete: Don't autocomplete at all on most control characters

Gabriel Ivăncescu gabrielopcode at gmail.com
Sat Sep 22 09:53:42 CDT 2018


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 at gmail.com>
---

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




More information about the wine-devel mailing list