1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-16 16:29:55 +00:00

Don't give commas special meaning when matching comments to openmw.cfg values

Previously, comments would be associated with the openmw.cfg line that followed them, but only up to the first comma.
This meant that if you had fallback=thing,otherthing and fallback=thing,thirdthing, comments above the thirdthing line would be moved above the otherthing line, even though both lines would be kept when the file was written out.

This seemed to be an attempt at a feature when cc9cii first implemented the comment preservation system, but it only seems to cause confusion.
This commit is contained in:
AnyOldName3 2025-01-09 15:21:14 +00:00
parent 4c9206485b
commit 29af981345

View file

@ -325,7 +325,7 @@ bool Config::GameSettings::writeFileWithComments(QFile& file)
// +----------------------------------------------------------+
//
//
QRegularExpression settingRegex("^([^=]+)\\s*=\\s*([^,]+)(.*)$");
QRegularExpression settingRegex("^([^=]+)\\s*=\\s*(.+?)\\s*$");
std::vector<QString> comments;
auto commentStart = fileCopy.end();
std::map<QString, std::vector<QString>> commentsMap;