+ auto completion wrap around

This commit is contained in:
Rainer Kottenhoff 2019-09-20 16:04:49 +02:00
parent bf17732a74
commit 50e893bf7f
3 changed files with 8 additions and 3 deletions

View File

@ -218,10 +218,12 @@ void AutoComplete::Move(int delta) {
const int count = lb->Length();
int current = lb->GetSelection();
current += delta;
// >>>>>>>>>>>>>>> BEG NON STD SCI PATCH >>>>>>>>>>>>>>>
if (current >= count)
current = count - 1;
current = (current == count ? 0 : count - 1);
if (current < 0)
current = 0;
current = (current == -1 ? count - 1 : 0);
// <<<<<<<<<<<<<<< END NON STD SCI PATCH <<<<<<<<<<<<<<<
lb->Select(current);
}

View File

@ -7066,10 +7066,11 @@ bool EditAutoCompleteWord(HWND hwnd, bool autoInsert)
// cppcheck-suppress constArgument
SciCall_AutoCSetSeperator(sep[0]);
SciCall_AutoCSetIgnoreCase(true);
//SendMessage(hwnd, SCI_AUTOCSETCASEINSENSITIVEBEHAVIOUR, (WPARAM)SC_CASEINSENSITIVEBEHAVIOUR_IGNORECASE, 0);
//~SciCall_AutoCSetCaseInsensitiveBehaviour(SC_CASEINSENSITIVEBEHAVIOUR_IGNORECASE);
SciCall_AutoCSetChooseSingle(autoInsert);
//~SciCall_AutoCSetOrder(SC_ORDER_PERFORMSORT); // already sorted
SciCall_AutoCSetFillups(AutoCompleteFillUpChars);
//~SciCall_AutoCSetMulti(SC_MULTIAUTOC_EACH);
++iWListSize; // zero termination
char* const pList = AllocMem(iWListSize, HEAP_ZERO_MEMORY);

View File

@ -317,10 +317,12 @@ DeclareSciCallR0(AutoCActive, AUTOCACTIVE, bool)
DeclareSciCallV0(AutoCComplete, AUTOCCOMPLETE)
DeclareSciCallV0(AutoCCancel, AUTOCCANCEL)
DeclareSciCallV1(AutoCSetIgnoreCase, AUTOCSETIGNORECASE, bool, flag)
DeclareSciCallV1(AutoCSetCaseInsensitiveBehaviour, AUTOCSETCASEINSENSITIVEBEHAVIOUR, int, options)
DeclareSciCallV1(AutoCSetSeperator, AUTOCSETSEPARATOR, char, seperator)
DeclareSciCallV01(AutoCSetFillups, AUTOCSETFILLUPS, const char*, text)
DeclareSciCallV1(AutoCSetChooseSingle, AUTOCSETCHOOSESINGLE, bool, flag)
DeclareSciCallV1(AutoCSetOrder, AUTOCSETORDER, int, options)
DeclareSciCallV1(AutoCSetMulti, AUTOCSETMULTI, int, options)
DeclareSciCallV2(AutoCShow, AUTOCSHOW, DocPos, len, const char*, list)