From 69a20db081e3b4434e2b8ef7e8a5a37a0647b391 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Wed, 22 Jun 2022 08:32:46 -0700 Subject: [PATCH] Update changelog and fix an apidoc comment --- ChangeLog.rst | 55 ++++++++++++++++++++++++++++++++++++++++----- include/fmt/color.h | 3 ++- 2 files changed, 51 insertions(+), 7 deletions(-) diff --git a/ChangeLog.rst b/ChangeLog.rst index 8c96b8a6..68d3d1e9 100644 --- a/ChangeLog.rst +++ b/ChangeLog.rst @@ -21,11 +21,41 @@ Thanks `@phprus (Vladislav Shchapov) `_. +* Added ``fmt::styled`` that applies a text style to an individual argument + (`#2793 `_). + For example (`godbolt `__): + + .. code:: c++ + + #include + #include + + int main() { + auto now = std::chrono::system_clock::now(); + fmt::print( + "[{}] {}: {}\n", + fmt::styled(now, fmt::emphasis::bold), + fmt::styled("error", fg(fmt::color::red)), + "something went wrong"); + } + + prints + + .. image:: https://user-images.githubusercontent.com/576385/ + 175071215-12809244-dab0-4005-96d8-7cd911c964d5.png + + Thanks `@rbrugo (Riccardo Brugo) `_. + * Implemented escaping of wide strings in ranges (`#2904 `_). Thanks `@phprus (Vladislav Shchapov) `_. -* Made compile-time checks with named arguments of custom types and +* Added support for ranges with ``begin`` / ``end`` found via the + argument-dependent lookup + (`#2807 `_). + Thanks `@rbrugo (Riccardo Brugo) `_. + +* Made compile-time checks work with named arguments of custom types and ``std::ostream`` ``print`` overloads (`#2816 `_, `#2817 `_, @@ -41,9 +71,15 @@ Thanks `@davidchisnall (David Chisnall) `_. * Improved documentation - (`#2815 `_, + (`#2789 `_, + `#2803 `_, + `#2805 `_, + `#2815 `_, `#2924 `_). - Thanks `@anoonD (cre) `_, + Thanks `@setoye (Alta) `_, + `@rtobar `_, + `@rbrugo (Riccardo Brugo) `_, + `@anoonD (cre) `_, `@leha-bot (Alex) `_. * Improved build configuration @@ -59,9 +95,12 @@ `@Vertexwahn `_. * Fixed various warnings and compilation issues - (`@timsong-cpp `_, + (`#2796 `_, + `#2797 `_, + `#2801 `_, + `#2802 `_, `#2818 `_, - `#2819 `_ + `#2819 `_, `#2861 `_, `#2882 `_, `#2892 `_, @@ -73,7 +112,11 @@ `#2937 `_, `#2938 `_, `#2940 `_). - Thanks `@seanm (Sean McBride) `_, + Thanks `@dalboris (Boris Dalstein) `_, + `@seanm (Sean McBride) `_, + `@gsjaardema (Greg Sjaardema) `_, + `@timsong-cpp `_, + `@seanm (Sean McBride) `_, `@frithrah `_, `@chronoxor (Ivan Shynkarenka) `_, `@Agga `_, diff --git a/include/fmt/color.h b/include/fmt/color.h index 9e1bc536..e6212d24 100644 --- a/include/fmt/color.h +++ b/include/fmt/color.h @@ -636,7 +636,8 @@ struct formatter, Char> : formatter { fmt::print("Elapsed time: {s:.2f} seconds", fmt::styled(1.23, fmt::fg(fmt::color::green) | - fmt::bg(fmt::color::blue))); \endrst + fmt::bg(fmt::color::blue))); + \endrst */ template FMT_CONSTEXPR auto styled(const T& value, text_style ts)