- Supports 'color.uda.<name>.<value>' (TW-1428)
This commit is contained in:
Johannes Schlatow 2014-10-10 14:19:07 +02:00 committed by Paul Beckingham
parent aa89422b6f
commit 2c7013cc1c
4 changed files with 25 additions and 3 deletions

View file

@ -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);
}
}
////////////////////////////////////////////////////////////////////////////////