Skip to content

Commit

Permalink
Improve case insensitive auto-completion, issue #654.
Browse files Browse the repository at this point in the history
  • Loading branch information
zufuliu committed May 1, 2023
1 parent 5258246 commit f66089f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 4 additions & 0 deletions scintilla/src/AutoComplete.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ char AutoComplete::GetTypesep() const noexcept {
return typesep;
}

namespace {

struct Sorter {
const AutoComplete *ac;
const char *list;
Expand Down Expand Up @@ -155,6 +157,8 @@ struct Sorter {
}
};

}

void AutoComplete::SetList(const char *list) {
if (autoSort == Ordering::PreSorted) {
lb->SetList(list, separator, typesep);
Expand Down
6 changes: 2 additions & 4 deletions src/EditAutoC.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ void WordList_Init(struct WordList *pWList, LPCSTR pRoot, UINT iRootLen, bool bI
pWList->iStartLen = iRootLen;

if (bIgnoreCase) {
pWList->WL_strcmp = _stricmp;
pWList->WL_strcmp = strcmp;
pWList->WL_strncmp = _strnicmp;
#if NP2_AUTOC_USE_STRING_ORDER
pWList->WL_OrderFunc = WordList_OrderCase;
Expand Down Expand Up @@ -1657,9 +1657,7 @@ static bool EditCompleteWordCore(int iCondition, bool autoInsert) {
SciCall_AutoCSetOptions(SC_AUTOCOMPLETE_FIXED_SIZE);
SciCall_AutoCSetOrder(SC_ORDER_PRESORTED); // pre-sorted
SciCall_AutoCSetIgnoreCase(bIgnoreCase); // case sensitivity
//if (bIgnoreCase) {
// SciCall_AutoCSetCaseInsensitiveBehaviour(SC_CASEINSENSITIVEBEHAVIOUR_IGNORECASE);
//}
SciCall_AutoCSetCaseInsensitiveBehaviour(bIgnoreCase);
//SciCall_AutoCSetSeparator('\n');
//SciCall_AutoCSetTypeSeparator('\t');
SciCall_AutoCSetFillUps(autoCompletionConfig.szAutoCompleteFillUp);
Expand Down

0 comments on commit f66089f

Please sign in to comment.