From 9a30ae7c371bd1b50308363e11fc55506c16903c Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Thu, 3 Oct 2024 03:34:54 +0200 Subject: [PATCH] Trim newlines --- src/Core/Settings.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Core/Settings.cpp b/src/Core/Settings.cpp index a91b52a4780..73a418cc308 100644 --- a/src/Core/Settings.cpp +++ b/src/Core/Settings.cpp @@ -6209,7 +6209,15 @@ void Settings::dumpToSystemSettingsColumns(MutableColumnsAndConstraints & params { res_columns[1]->insert(setting.getValueString()); res_columns[2]->insert(setting.isValueChanged()); - res_columns[3]->insert(setting.getDescription()); + + /// Trim starting/ending newline. + std::string_view doc = setting.getDescription(); + if (doc.length() > 0 && doc[0] == '\n') + doc = doc.substr(1); + if (doc.length() > 0 && doc[doc.length() - 1] == '\n') + doc = doc.substr(0, doc.length() - 1); + + res_columns[3]->insert(doc); Field min, max; SettingConstraintWritability writability = SettingConstraintWritability::WRITABLE;