From: Gabriel Ivăncescu Subject: [PATCH v2 1/8] shell32/autocomplete: Fix going up through the suggestion listbox Message-Id: Date: Thu, 20 Sep 2018 14:55:34 +0300 When going up past the topmost item in the listbox, go through txtbackup first before wrapping around, just like when going down. This matches Windows behavior. Signed-off-by: Gabriel Ivăncescu --- This series supersedes patches from 150637 to 150639. dlls/shell32/autocomplete.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/shell32/autocomplete.c b/dlls/shell32/autocomplete.c index e3fe1fd..0471146 100644 --- a/dlls/shell32/autocomplete.c +++ b/dlls/shell32/autocomplete.c @@ -296,7 +296,7 @@ static LRESULT ACEditSubclassProc_KeyDown(IAutoCompleteImpl *ac, HWND hwnd, UINT /* Change the selection */ sel = SendMessageW(ac->hwndListBox, LB_GETCURSEL, 0, 0); if (wParam == VK_UP) - sel = ((sel - 1) < 0) ? count - 1 : sel - 1; + sel = ((sel - 1) < -1) ? count - 1 : sel - 1; else sel = ((sel + 1) >= count) ? -1 : sel + 1; SendMessageW(ac->hwndListBox, LB_SETCURSEL, sel, 0); -- 1.9.1