From 29af981345a92594ff3975ea0ee583738df93f34 Mon Sep 17 00:00:00 2001 From: AnyOldName3 Date: Thu, 9 Jan 2025 15:21:14 +0000 Subject: [PATCH] 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. --- components/config/gamesettings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/config/gamesettings.cpp b/components/config/gamesettings.cpp index 3210716a5c..bf8cdef933 100644 --- a/components/config/gamesettings.cpp +++ b/components/config/gamesettings.cpp @@ -325,7 +325,7 @@ bool Config::GameSettings::writeFileWithComments(QFile& file) // +----------------------------------------------------------+ // // - QRegularExpression settingRegex("^([^=]+)\\s*=\\s*([^,]+)(.*)$"); + QRegularExpression settingRegex("^([^=]+)\\s*=\\s*(.+?)\\s*$"); std::vector comments; auto commentStart = fileCopy.end(); std::map> commentsMap;