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

Fix #12325, close #13875
This commit is contained in:
Don Ho 2023-07-09 01:52:37 +02:00
parent d9b98681f4
commit ebdc910dcd

View File

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