mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-26 15:47:19 +02:00
CmdNews: Work around blending not supporting bold effect
This commit is contained in:
parent
4f1af72235
commit
506307fb87
1 changed files with 6 additions and 3 deletions
|
@ -83,13 +83,16 @@ NewsItem::NewsItem (bool major, const std::string& title, const std::string& upd
|
||||||
void NewsItem::render () {
|
void NewsItem::render () {
|
||||||
auto config = Context::getContext ().config;
|
auto config = Context::getContext ().config;
|
||||||
Color header;
|
Color header;
|
||||||
|
Color bold;
|
||||||
if (Context::getContext ().color ()) {
|
if (Context::getContext ().color ()) {
|
||||||
header = Color ("bold");
|
bold = Color ("bold");
|
||||||
if (config.has ("color.header"))
|
if (config.has ("color.header"))
|
||||||
header.blend(Color (config.get ("color.header")));
|
header = Color (config.get ("color.header"));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout << header.colorize (format ("{1}\n", _title));
|
// TODO: For some reason, bold cannot be blended in 256-color terminals
|
||||||
|
// Apply this workaround of colorizing twice.
|
||||||
|
std::cout << bold.colorize (header.colorize (format ("{1}\n", _title)));
|
||||||
std::cout << format ("\n{1}\n", _update);
|
std::cout << format ("\n{1}\n", _update);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue