Skip to content

Commit

Permalink
Fix "User-defined keywords" not being saved properly (Style Config)
Browse files Browse the repository at this point in the history
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 notepad-plus-plus#15543, fix notepad-plus-plus#14303
  • Loading branch information
donho committed Aug 16, 2024
1 parent 9e42900 commit c1954e5
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions PowerEditor/src/Parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c1954e5

Please sign in to comment.