color: bugfix: color_off() needs to know color spec
This commit is contained in:
parent
b2d939363e
commit
3983361e78
2 changed files with 6 additions and 6 deletions
|
|
@ -175,19 +175,19 @@ namespace xo {
|
|||
}; /*color_impl*/
|
||||
|
||||
template <typename Contents>
|
||||
color_impl<Contents> with_color(color_spec_type spec, Contents && contents) {
|
||||
color_impl<Contents> with_color(color_spec_type const & spec, Contents && contents) {
|
||||
return color_impl<Contents>(coloring_control_flags::all, spec, std::forward<Contents>(contents));
|
||||
} /*with_color*/
|
||||
|
||||
inline color_impl<int>
|
||||
color_on(color_spec_type spec) {
|
||||
color_on(color_spec_type const & spec) {
|
||||
return color_impl<int>(coloring_control_flags::color_on, spec, 0);
|
||||
} /*color_on*/
|
||||
|
||||
inline color_impl<int>
|
||||
color_off() {
|
||||
color_off(color_spec_type const & spec) {
|
||||
/* any spec other than color_spec_type::none() works here */
|
||||
return color_impl<int>(coloring_control_flags::color_off, color_spec_type::white(), 0);
|
||||
return color_impl<int>(coloring_control_flags::color_off, spec, 0);
|
||||
} /*color_off*/
|
||||
|
||||
template <typename Contents>
|
||||
|
|
|
|||
|
|
@ -262,12 +262,12 @@ namespace xo {
|
|||
/* omit namespace qualifiers and template arguments */
|
||||
os << color_on(fn.colorspec());
|
||||
function_name::print_streamlined(os, fn.pretty());
|
||||
os << color_off();
|
||||
os << color_off(fn.colorspec());
|
||||
break;
|
||||
case function_style::simple:
|
||||
os << color_on(fn.colorspec());
|
||||
function_name::print_simple(os, fn.pretty());
|
||||
os << color_off();
|
||||
os << color_off(fn.colorspec());
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue