mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Tree
- Parse tree is now colored to match the old one, somewhat.
This commit is contained in:
parent
3e5dc56773
commit
57b876f005
1 changed files with 14 additions and 3 deletions
17
src/Tree.cpp
17
src/Tree.cpp
|
@ -274,11 +274,22 @@ void Tree::dumpNode (Tree* t, int depth, std::stringstream& output)
|
||||||
std::string tags;
|
std::string tags;
|
||||||
std::vector <std::string>::iterator tag;
|
std::vector <std::string>::iterator tag;
|
||||||
for (tag = t->_tags.begin (); tag != t->_tags.end (); ++tag)
|
for (tag = t->_tags.begin (); tag != t->_tags.end (); ++tag)
|
||||||
tags += (tags.length () ? " " : "") + *tag;
|
{
|
||||||
|
if (tags.length ())
|
||||||
|
tags += ' ';
|
||||||
|
|
||||||
|
if (*tag == "BINARY") tags += "\033[1;37;44m" + *tag + "\033[0m";
|
||||||
|
else if (*tag == "CMD") tags += "\033[1;37;46m" + *tag + "\033[0m";
|
||||||
|
else if (*tag == "FILTER") tags += "\033[1;37;42m" + *tag + "\033[0m";
|
||||||
|
else if (*tag == "MODIFICATION") tags += "\033[1;37;43m" + *tag + "\033[0m";
|
||||||
|
else if (*tag == "RC") tags += "\033[1;37;41m" + *tag + "\033[0m";
|
||||||
|
else if (*tag == "CONFIG") tags += "\033[1;37;101m" + *tag + "\033[0m";
|
||||||
|
else if (*tag == "?") tags += "\033[38;5;255;48;5;232m" + *tag + "\033[0m";
|
||||||
|
else tags += "\033[32m" + *tag + "\033[0m";
|
||||||
|
}
|
||||||
|
|
||||||
if (tags.length ())
|
if (tags.length ())
|
||||||
output << " \033[32m" << tags << "\033[0m";
|
output << ' ' << tags;
|
||||||
|
|
||||||
output << "\n";
|
output << "\n";
|
||||||
|
|
||||||
// Recurse for branches.
|
// Recurse for branches.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue