diff options
author | Ben Burdette <bburdette@gmail.com> | 2020-06-22 11:32:20 -0600 |
---|---|---|
committer | Ben Burdette <bburdette@gmail.com> | 2020-06-22 11:32:20 -0600 |
commit | 9d1cb0c5e64db3e34896ac43de978f132860f894 (patch) | |
tree | a72fd7c5c59a03ad83bf785d9d35d9ce70a76c3c /src/libutil/fmt.hh | |
parent | 28b079067f4248c81b8946c459435c7a91dc2971 (diff) |
with normaltxt, elide yellow color code instead of canceling it; use normaltxt on plain_string hintfmt
Diffstat (limited to 'src/libutil/fmt.hh')
-rw-r--r-- | src/libutil/fmt.hh | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libutil/fmt.hh b/src/libutil/fmt.hh index dc7fe8056..a39de041f 100644 --- a/src/libutil/fmt.hh +++ b/src/libutil/fmt.hh @@ -120,6 +120,13 @@ public: return *this; } + template<class T> + hintformat& operator%(const normaltxt<T> &value) + { + fmt % value.value; + return *this; + } + std::string str() const { return fmt.str(); @@ -142,6 +149,6 @@ inline hintformat hintfmt(const std::string & fs, const Args & ... args) inline hintformat hintfmt(std::string plain_string) { // we won't be receiving any args in this case, so just print the original string - return hintfmt("%s", plain_string); + return hintfmt("%s", normaltxt(plain_string)); } } |