- added tab-completion of built-in tags
This commit is contained in:
Johannes Schlatow 2011-03-13 01:32:44 +01:00
parent 236b017d57
commit 6d6a5492bb
2 changed files with 10 additions and 1 deletions

View file

@ -5,6 +5,7 @@
+ autoconf eliminated.
+ Corrected sorting to use std::stable_sort instead of std::sort, which is not
guaranteed stable (thanks to Stefan Hacker).
+ Added feature #700, which adds tab-completion of built-in tags.
------ old releases ------------------------------

View file

@ -469,7 +469,7 @@ int handleCompletionTags (std::string& outs)
context.tdb.commit ();
context.tdb.unlock ();
// Scan all the tasks for their project name, building a map using project
// Scan all the tasks for their tags, building a map using tag
// names as keys.
std::map <std::string, int> unique;
foreach (t, tasks)
@ -481,6 +481,14 @@ int handleCompletionTags (std::string& outs)
unique[*tag] = 0;
}
// add built-in tags to map
unique["nocolor"] = 0;
unique["nonag"] = 0;
unique["nocal"] = 0;
unique["next"] = 0;
unique["stall"] = 0;
unique["someday"] = 0;
std::stringstream out;
foreach (tag, unique)
out << tag->first << "\n";