Fix "User-defined keywords" not being saved properly (Style Config)

When "User-defined keywords" field has been set keywords, removing all keywords then saving doesn't have any change (the keywords are kept after saving). The commit fix it.

Fix #15543, fix #14303
This commit is contained in:
Don Ho 2024-08-15 18:48:14 +02:00
parent 9e4290094d
commit c1954e5c44
1 changed files with 6 additions and 8 deletions

View File

@ -8490,15 +8490,13 @@ void NppParameters::writeStyle2Element(const Style & style2Write, Style & style2
}
if (!style2Write._keywords.empty())
{
TiXmlNode *teteDeNoeud = element->LastChild();
TiXmlNode *teteDeNoeud = element->LastChild();
if (teteDeNoeud)
teteDeNoeud->SetValue(style2Write._keywords.c_str());
else
element->InsertEndChild(TiXmlText(style2Write._keywords.c_str()));
if (teteDeNoeud)
teteDeNoeud->SetValue(style2Write._keywords.c_str());
else
element->InsertEndChild(TiXmlText(style2Write._keywords.c_str()));
}
}
void NppParameters::insertUserLang2Tree(TiXmlNode *node, UserLangContainer *userLang)