- Properly skips all escape sequences if no fg and bg colors are specified.
This commit is contained in:
@@ -242,7 +242,10 @@ std::string decode (color c)
|
|||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
std::string colorize (color fg, color bg, const std::string& input)
|
std::string colorize (color fg, color bg, const std::string& input)
|
||||||
{
|
{
|
||||||
return decode (fg) + decode (bg) + input + decode (off);
|
if (fg != nocolor || bg != nocolor)
|
||||||
|
return decode (fg) + decode (bg) + input + decode (off);
|
||||||
|
|
||||||
|
return input;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
Reference in New Issue
Block a user