+ Added feature #679, which makes color rules match project names in a left-
  most fashion, like filters (thanks to ch077179).
This commit is contained in:
Paul Beckingham 2011-04-22 00:29:30 -04:00
parent 4f4a04738f
commit 83320a3e07
2 changed files with 9 additions and 2 deletions

View file

@ -26,6 +26,8 @@
Peter De Poorter and Bryce Harrington).
+ Added feature #657 & #658, using the 'ids' command, tasks matching a filter
can now be modified as a group (thanks to Bryce Harrington, Eric Fluger).
+ Added feature #679, which makes color rules match project names in a left-
most fashion, like filters (thanks to ch077179).
+ Added feature #700, which adds tab-completion of built-in tags.
+ Added feature #710, which adds an attribute modifier prefix to return the
complement of a filtered set (thanks to Dan White).

View file

@ -153,8 +153,13 @@ static void colorizeProject (Task& task, const std::string& rule, Color& c)
// Observe the case sensitivity setting.
bool sensitive = context.config.getBoolean ("search.case.sensitive");
if (compare (task.get ("project"), rule.substr (14), sensitive))
c.blend (gsColor[rule]);
std::string project = task.get ("project");
std::string rule_trunc = rule.substr (14);
// Match project names leftmost, just like Context::autoFilter.
if (rule_trunc.length () <= project.length ())
if (compare (rule_trunc, project.substr (0, rule_trunc.length ()), sensitive))
c.blend (gsColor[rule]);
}
////////////////////////////////////////////////////////////////////////////////