From f2e4778afaab128bfc1b617b4596bd096bf45acb Mon Sep 17 00:00:00 2001 From: ltGuillaume Date: Fri, 20 Sep 2019 00:55:14 +0200 Subject: [PATCH] Autocomplete selection: wrap movement Source: https://sourceforge.net/p/scintilla/feature-requests/1031/ --- scintilla/src/AutoComplete.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scintilla/src/AutoComplete.cxx b/scintilla/src/AutoComplete.cxx index 7a8b6b201..d042c19e6 100644 --- a/scintilla/src/AutoComplete.cxx +++ b/scintilla/src/AutoComplete.cxx @@ -219,9 +219,9 @@ void AutoComplete::Move(int delta) { int current = lb->GetSelection(); current += delta; if (current >= count) - current = count - 1; + current = (current == count ? 0 : count - 1); if (current < 0) - current = 0; + current = (current == -1 ? count - 1 : 0); lb->Select(current); }