- TW-1298 The color 'orange' is not recognized. - taskwarrior will not start
          anymore (thanks to Bernd Humpa).
This commit is contained in:
Paul Beckingham 2014-04-15 23:37:05 -04:00
parent c03df08d1e
commit 2aa224d278
3 changed files with 39 additions and 28 deletions

View file

@ -207,3 +207,4 @@ suggestions:
Michele Vetturi Michele Vetturi
Jeremiah Marks Jeremiah Marks
Profpatsch Profpatsch
Bernd Humpa

View file

@ -42,6 +42,8 @@
Wilk). Wilk).
- TW-1296 make test/run_all exit with non-zero code if a test fail (thanks to - TW-1296 make test/run_all exit with non-zero code if a test fail (thanks to
Jakub Wilk). 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-1300 _get could use return codes (thanks to Scott Kostyshak).
- TW-1301 Virtual tag +PENDING (thanks to Profpatsch). - TW-1301 Virtual tag +PENDING (thanks to Profpatsch).
- TW-1302 CmdShow.cpp:244: bad length in substr ? (thanks to David Binderman). - TW-1302 CmdShow.cpp:244: bad length in substr ? (thanks to David Binderman).

View file

@ -41,40 +41,48 @@ static Date now;
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
void initializeColorRules () void initializeColorRules ()
{ {
gsColor.clear (); try
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)
{ {
if (v->first.substr (0, 6) == "color.") gsColor.clear ();
{ gsPrecedence.clear ();
Color c (v->second);
gsColor[v->first] = c;
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 catch (const std::string& e)
// 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. context.error (e);
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);
} }
} }