From 693822a01eefec4ac9ae0099c5f64145d1a37e0a Mon Sep 17 00:00:00 2001 From: Toni500git Date: Sat, 26 Oct 2024 12:18:40 +0200 Subject: [PATCH] parse: fix aligning if failed to parse color --- src/parse.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/parse.cpp b/src/parse.cpp index 93896b0..53dce7d 100644 --- a/src/parse.cpp +++ b/src/parse.cpp @@ -451,6 +451,8 @@ std::optional parse_color_tag(Parser& parser, parse_args_t& parse_a else { error("PARSER: failed to parse line with color '{}'", str_clr); + if (!parse_args.parsingLayout && tagpos != std::string::npos) + parse_args.pureOutput.erase(tagpos, taglen); return output; } } @@ -543,6 +545,8 @@ std::optional parse_color_tag(Parser& parser, parse_args_t& parse_a else { error("PARSER: failed to parse line with color '{}'", str_clr); + if (!parse_args.parsingLayout && tagpos != std::string::npos) + parse_args.pureOutput.erase(tagpos, taglen); return output; } }