Skip to content

Commit

Permalink
[case insensitive auto-completion] include all words with different c…
Browse files Browse the repository at this point in the history
…asing, issue #654.
  • Loading branch information
zufuliu committed May 2, 2023
1 parent f66089f commit 6691b75
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/EditAutoC.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ struct WordList {
UINT iStartLen;
#if NP2_AUTOC_USE_STRING_ORDER
UINT orderStart;
bool bIgnoreOrder;
#endif
UINT nWordCount;
UINT nTotalLen;
Expand Down Expand Up @@ -191,7 +192,7 @@ void WordList_AddWord(struct WordList *pWList, LPCSTR pWord, UINT len) {
path[top++] = iter;
#if NP2_AUTOC_USE_STRING_ORDER
dir = (int)(iter->order - order);
if (dir == 0 && (len > NP2_AUTOC_ORDER_LENGTH || iter->len > NP2_AUTOC_ORDER_LENGTH)) {
if (dir == 0 && (len > NP2_AUTOC_ORDER_LENGTH || iter->len > NP2_AUTOC_ORDER_LENGTH || pWList->bIgnoreOrder)) {
dir = pWList->WL_strcmp(WordNode_GetWord(iter), pWord);
}
#else
Expand Down Expand Up @@ -303,6 +304,7 @@ void WordList_Init(struct WordList *pWList, LPCSTR pRoot, UINT iRootLen, bool bI
}
#if NP2_AUTOC_USE_STRING_ORDER
pWList->orderStart = pWList->WL_OrderFunc(pRoot, iRootLen);
pWList->bIgnoreOrder = bIgnoreCase;
#endif

pWList->capacity = NP2_AUTOC_INIT_BUFFER_SIZE;
Expand Down

0 comments on commit 6691b75

Please sign in to comment.