From aaae35f42d54e2e389f76731bae4b5075f494539 Mon Sep 17 00:00:00 2001 From: Tanki Zhang Date: Wed, 9 Oct 2019 23:18:47 -0400 Subject: [PATCH] update implementation, formatting --- include/fmt/color.h | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/include/fmt/color.h b/include/fmt/color.h index a6fb675e..a10e8305 100644 --- a/include/fmt/color.h +++ b/include/fmt/color.h @@ -512,23 +512,21 @@ void vprint(std::FILE* f, const text_style& ts, const S& format, } if (ts.has_foreground()) { has_style = true; - auto foreground = internal::make_foreground_color(ts.get_foreground()); + auto foreground = + internal::make_foreground_color(ts.get_foreground()); buf.append(foreground.begin(), foreground.end()); } if (ts.has_background()) { has_style = true; - auto background = internal::make_background_color(ts.get_background()); + auto background = + internal::make_background_color(ts.get_background()); buf.append(background.begin(), background.end()); } - - format_to( buf, "{}", format ); - + vformat_to(buf, format, args); if (has_style) { - reset_color( buf ); + reset_color(buf); } - - - vprint(f, buf.data(), args); + internal::fputs(buf.data(), f); } /**