Skip to content

Commit 0e0ca24

Browse files
ozone10donho
authored andcommitted
Fix regression of EOL ignored in multiline text of native lang
Fix notepad-plus-plus@9f39665#commitcomment-174988340 Close notepad-plus-plus#17422
1 parent 9f39665 commit 0e0ca24

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

PowerEditor/src/NppXml.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ namespace NppXml
3939
return doc->save_file(filename, " ", pugi::format_indent | pugi::format_save_file_text);
4040
}
4141

42+
[[nodiscard]] inline bool loadFileNativeLang(Document doc, const wchar_t* filename) {
43+
return doc->load_file(filename, pugi::parse_cdata | pugi::parse_escapes | pugi::parse_eol | pugi::parse_comments | pugi::parse_declaration);
44+
}
45+
4246
[[nodiscard]] inline bool loadFileShortcut(Document doc, const wchar_t* filename) {
4347
return doc->load_file(filename, pugi::parse_cdata | pugi::parse_escapes | pugi::parse_comments | pugi::parse_declaration);
4448
}

PowerEditor/src/Parameters.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,7 +1163,7 @@ bool NppParameters::reloadLang()
11631163
delete _pXmlNativeLangDoc;
11641164

11651165
_pXmlNativeLangDoc = new NppXml::NewDocument();
1166-
const bool loadOkay = NppXml::loadFile(_pXmlNativeLangDoc, nativeLangPath.c_str());
1166+
const bool loadOkay = NppXml::loadFileNativeLang(_pXmlNativeLangDoc, nativeLangPath.c_str());
11671167
if (!loadOkay)
11681168
{
11691169
delete _pXmlNativeLangDoc;
@@ -1541,7 +1541,7 @@ bool NppParameters::load()
15411541
}
15421542

15431543
_pXmlNativeLangDoc = new NppXml::NewDocument();
1544-
loadOkay = NppXml::loadFile(_pXmlNativeLangDoc, nativeLangPath.c_str());
1544+
loadOkay = NppXml::loadFileNativeLang(_pXmlNativeLangDoc, nativeLangPath.c_str());
15451545
if (!loadOkay)
15461546
{
15471547
delete _pXmlNativeLangDoc;

0 commit comments

Comments
 (0)