diff --git a/ChangeLog b/ChangeLog index 6086f8af6..132c253cd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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). diff --git a/src/rules.cpp b/src/rules.cpp index 908f18ac5..3b2ab196c 100644 --- a/src/rules.cpp +++ b/src/rules.cpp @@ -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]); } ////////////////////////////////////////////////////////////////////////////////