Feature #679
+ 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:
@@ -26,6 +26,8 @@
|
|||||||
Peter De Poorter and Bryce Harrington).
|
Peter De Poorter and Bryce Harrington).
|
||||||
+ Added feature #657 & #658, using the 'ids' command, tasks matching a filter
|
+ 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).
|
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 #700, which adds tab-completion of built-in tags.
|
||||||
+ Added feature #710, which adds an attribute modifier prefix to return the
|
+ Added feature #710, which adds an attribute modifier prefix to return the
|
||||||
complement of a filtered set (thanks to Dan White).
|
complement of a filtered set (thanks to Dan White).
|
||||||
|
|||||||
@@ -153,8 +153,13 @@ static void colorizeProject (Task& task, const std::string& rule, Color& c)
|
|||||||
// Observe the case sensitivity setting.
|
// Observe the case sensitivity setting.
|
||||||
bool sensitive = context.config.getBoolean ("search.case.sensitive");
|
bool sensitive = context.config.getBoolean ("search.case.sensitive");
|
||||||
|
|
||||||
if (compare (task.get ("project"), rule.substr (14), sensitive))
|
std::string project = task.get ("project");
|
||||||
c.blend (gsColor[rule]);
|
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]);
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
Reference in New Issue
Block a user