mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-29 17:07:19 +02:00
Color
- Supports 'color.uda.<name>.<value>' (TW-1428)
This commit is contained in:
parent
aa89422b6f
commit
2c7013cc1c
4 changed files with 25 additions and 3 deletions
|
@ -225,8 +225,19 @@ static void colorizeKeyword (Task& task, const std::string& rule, const Color& b
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
static void colorizeUDA (Task& task, const std::string& rule, const Color& base, Color& c)
|
||||
{
|
||||
if (task.has (rule.substr (10)))
|
||||
c.blend (base);
|
||||
// Is the rule uda.name.value or uda.name?
|
||||
size_t pos = rule.find (".", 10);
|
||||
if (pos == std::string::npos)
|
||||
{
|
||||
if (task.has (rule.substr (10)))
|
||||
c.blend (base);
|
||||
}
|
||||
else {
|
||||
const std::string uda = rule.substr (10, pos-10);
|
||||
const std::string val = rule.substr (pos+1);
|
||||
if (task.get (uda) == val)
|
||||
c.blend (base);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue