mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
TW-1298
- TW-1298 The color 'orange' is not recognized. - taskwarrior will not start anymore (thanks to Bernd Humpa).
This commit is contained in:
parent
c03df08d1e
commit
2aa224d278
3 changed files with 39 additions and 28 deletions
1
AUTHORS
1
AUTHORS
|
@ -207,3 +207,4 @@ suggestions:
|
|||
Michele Vetturi
|
||||
Jeremiah Marks
|
||||
Profpatsch
|
||||
Bernd Humpa
|
||||
|
|
|
@ -42,6 +42,8 @@
|
|||
Wilk).
|
||||
- TW-1296 make test/run_all exit with non-zero code if a test fail (thanks to
|
||||
Jakub Wilk).
|
||||
- TW-1298 The color 'orange' is not recognized. - taskwarrior will not start
|
||||
anymore (thanks to Bernd Humpa).
|
||||
- TW-1300 _get could use return codes (thanks to Scott Kostyshak).
|
||||
- TW-1301 Virtual tag +PENDING (thanks to Profpatsch).
|
||||
- TW-1302 CmdShow.cpp:244: bad length in substr ? (thanks to David Binderman).
|
||||
|
|
|
@ -41,40 +41,48 @@ static Date now;
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
void initializeColorRules ()
|
||||
{
|
||||
gsColor.clear ();
|
||||
gsPrecedence.clear ();
|
||||
|
||||
// Load all the configuration values, filter to only the ones that begin with
|
||||
// "color.", then store name/value in gsColor, and name in rules.
|
||||
std::vector <std::string> rules;
|
||||
Config::const_iterator v;
|
||||
for (v = context.config.begin (); v != context.config.end (); ++v)
|
||||
try
|
||||
{
|
||||
if (v->first.substr (0, 6) == "color.")
|
||||
{
|
||||
Color c (v->second);
|
||||
gsColor[v->first] = c;
|
||||
gsColor.clear ();
|
||||
gsPrecedence.clear ();
|
||||
|
||||
rules.push_back (v->first);
|
||||
// Load all the configuration values, filter to only the ones that begin with
|
||||
// "color.", then store name/value in gsColor, and name in rules.
|
||||
std::vector <std::string> rules;
|
||||
Config::const_iterator v;
|
||||
for (v = context.config.begin (); v != context.config.end (); ++v)
|
||||
{
|
||||
if (v->first.substr (0, 6) == "color.")
|
||||
{
|
||||
Color c (v->second);
|
||||
gsColor[v->first] = c;
|
||||
|
||||
rules.push_back (v->first);
|
||||
}
|
||||
}
|
||||
|
||||
// Load the rule.precedence.color list, split it, then autocomplete against
|
||||
// the 'rules' vector loaded above.
|
||||
std::vector <std::string> results;
|
||||
std::vector <std::string> precedence;
|
||||
split (precedence, context.config.get ("rule.precedence.color"), ',');
|
||||
|
||||
std::vector <std::string>::iterator p;
|
||||
for (p = precedence.begin (); p != precedence.end (); ++p)
|
||||
{
|
||||
// Add the leading "color." string.
|
||||
std::string rule = "color." + *p;
|
||||
autoComplete (rule, rules, results, 3); // Hard-coded 3.
|
||||
|
||||
std::vector <std::string>::iterator r;
|
||||
for (r = results.begin (); r != results.end (); ++r)
|
||||
gsPrecedence.push_back (*r);
|
||||
}
|
||||
}
|
||||
|
||||
// Load the rule.precedence.color list, split it, then autocomplete against
|
||||
// the 'rules' vector loaded above.
|
||||
std::vector <std::string> results;
|
||||
std::vector <std::string> precedence;
|
||||
split (precedence, context.config.get ("rule.precedence.color"), ',');
|
||||
|
||||
std::vector <std::string>::iterator p;
|
||||
for (p = precedence.begin (); p != precedence.end (); ++p)
|
||||
catch (const std::string& e)
|
||||
{
|
||||
// Add the leading "color." string.
|
||||
std::string rule = "color." + *p;
|
||||
autoComplete (rule, rules, results, 3); // Hard-coded 3.
|
||||
|
||||
std::vector <std::string>::iterator r;
|
||||
for (r = results.begin (); r != results.end (); ++r)
|
||||
gsPrecedence.push_back (*r);
|
||||
context.error (e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue