1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-28 19:45:47 +01:00

Better array option completion handling. Closes issue #159.

--HG--
extra : rebase_source : d5673d1bd406ab7096e2e7f73e8412972585a069
This commit is contained in:
Kris Maglione
2010-12-01 14:18:03 -05:00
parent 4de32441d7
commit cb0478ddd6
4 changed files with 14 additions and 10 deletions

View File

@@ -389,16 +389,8 @@ const Bookmarks = Module("bookmarks", {
names: ["-tags", "-T"],
description: "A comma-separated list of tags",
completer: function tags(context, args) {
// TODO: Move the bulk of this to parseArgs.
let filter = context.filter;
let have = filter.split(",");
args.completeFilter = have.pop();
let prefix = filter.substr(0, filter.length - args.completeFilter.length);
context.generate = function () array(b.tags for (b in bookmarkcache) if (b.tags)).flatten().uniq().array;
context.keys = { text: function (tag) prefix + tag, description: util.identity };
context.filters.push(function (tag) have.indexOf(tag) < 0);
context.keys = { text: util.identity, description: util.identity };
},
type: CommandOption.LIST
};