shell32/autocomplete: Fix going up through the suggestion listbox.

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 <gabrielopcode@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Gabriel Ivăncescu 2018-09-20 14:55:34 +03:00 committed by Alexandre Julliard
parent 47ab490427
commit cb8bd825b9
1 changed files with 1 additions and 1 deletions

View File

@ -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);