Fix Auto-Complete ignore case issue

Fix #3997, fix #4833, fix #4998
This commit is contained in:
Don HO 2021-03-30 03:46:28 +02:00
parent 4369718925
commit 70762b1a03
1 changed files with 13 additions and 1 deletions

View File

@ -101,7 +101,19 @@ bool AutoCompletion::showApiAndWordComplete()
bool canStop = false;
for (size_t i = 0, kwlen = _keyWordArray.size(); i < kwlen; ++i)
{
if (_keyWordArray[i].compare(0, len, beginChars) == 0)
int compareResult = 0;
if (_ignoreCase)
{
generic_string kwSufix = _keyWordArray[i].substr(0, len);
compareResult = generic_stricmp(beginChars, kwSufix.c_str());
}
else
{
compareResult = _keyWordArray[i].compare(0, len, beginChars);
}
if (compareResult == 0)
{
if (!isInList(_keyWordArray[i], wordArray))
wordArray.push_back(_keyWordArray[i]);