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:
@@ -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
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user