Fix normal.xml for Normal text auto-completion using not working issue

Fix #12325, close #13875
pull/13886/head
Don Ho 2023-07-09 01:52:37 +02:00
parent d9b98681f4
commit ebdc910dcd
1 changed files with 4 additions and 2 deletions

View File

@ -1081,8 +1081,9 @@ void AutoCompletion::callTipClick(size_t direction)
bool AutoCompletion::setLanguage(LangType language)
{
if (_curLang == language)
if (_curLang == language && _pXmlFile)
return true;
_curLang = language;
TCHAR path[MAX_PATH];
@ -1092,7 +1093,8 @@ bool AutoCompletion::setLanguage(LangType language)
wcscat_s(path, getApiFileName());
wcscat_s(path, TEXT(".xml"));
delete _pXmlFile;
if (_pXmlFile)
delete _pXmlFile;
_pXmlFile = new TiXmlDocument(path);
_funcCompletionActive = _pXmlFile->LoadFile();