From 3febd94266e092681600f9080d869314b93218d3 Mon Sep 17 00:00:00 2001 From: Stepland <10530295-Buggyroom@users.noreply.gitlab.com> Date: Sun, 20 Nov 2022 01:39:07 +0100 Subject: [PATCH] Fix config.toml formatting --- src/config.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/config.cpp b/src/config.cpp index 03002d3..9eb5f4f 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -9,6 +9,7 @@ #include "colors.hpp" #include "marker.hpp" +#include "toml++/impl/toml_formatter.h" #include "variant_visitor.hpp" #include "widgets/lane_order.hpp" @@ -301,7 +302,12 @@ config::Config::~Config() { std::filesystem::create_directories(config_path.parent_path()); const auto tbl = dump_as_v1_0_0(); std::ofstream config_file_stream{config_path}; - config_file_stream << tbl << std::endl; + const auto flags = ( + toml::toml_formatter::default_flags + & ~toml::format_flags::allow_literal_strings + & ~toml::format_flags::indent_sub_tables + ); + config_file_stream << toml::toml_formatter{tbl, flags} << std::endl; } void config::Config::load_from_v1_0_0_table(const toml::table& tbl) {