Expression

- Added configurable 'abbreviation.minimum' (default:2) setting to
  control how auto-completion works.
This commit is contained in:
Paul Beckingham 2011-07-20 10:48:59 -04:00
parent a6fadaee67
commit 197524a5fc
16 changed files with 139 additions and 52 deletions

View file

@ -301,7 +301,10 @@ bool Att::validNameValue (
candidates.push_back (modifiableNames[i]);
std::vector <std::string> matches;
autoComplete (name, candidates, matches);
autoComplete (name,
candidates,
matches,
context.config.getInteger ("abbreviation.minimum"));
if (matches.size () == 0)
return false;
@ -327,7 +330,10 @@ bool Att::validNameValue (
candidates.push_back (modifierNames[i]);
matches.clear ();
autoComplete (mod, candidates, matches);
autoComplete (mod,
candidates,
matches,
context.config.getInteger ("abbreviation.minimum"));
if (matches.size () == 0)
throw std::string ("Unrecognized modifier '") + mod + "'.";
@ -454,7 +460,10 @@ bool Att::validNameValue (
candidates.push_back ("deleted");
candidates.push_back ("recurring");
candidates.push_back ("waiting");
autoComplete (value, candidates, matches);
autoComplete (value,
candidates,
matches,
context.config.getInteger ("abbreviation.minimum"));
if (matches.size () == 1)
value = matches[0];