mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-03 14:05:47 +01:00
:lk <C-Foo> should work.
This commit is contained in:
@@ -249,7 +249,8 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
|||||||
let results = array(params.iterate(args))
|
let results = array(params.iterate(args))
|
||||||
.sort(function (a, b) String.localeCompare(a.name, b.name));
|
.sort(function (a, b) String.localeCompare(a.name, b.name));
|
||||||
|
|
||||||
let filters = args.map(function (arg) util.regexp("\\b" + util.regexp.escape(arg) + "\\b", "i"));
|
let filters = args.map(function (arg) let (re = util.regexp.escape(arg))
|
||||||
|
util.regexp("\\b" + re + "\\b|(?:^|[()\\s])" + re + "(?:$|[()\\s])", "i"));
|
||||||
if (filters.length)
|
if (filters.length)
|
||||||
results = results.filter(function (item) filters.every(function (re) keys(item).some(re.closure.test)));
|
results = results.filter(function (item) filters.every(function (re) keys(item).some(re.closure.test)));
|
||||||
|
|
||||||
@@ -261,10 +262,11 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
|||||||
completer: function (context, args) {
|
completer: function (context, args) {
|
||||||
context.keys.text = util.identity;
|
context.keys.text = util.identity;
|
||||||
context.keys.description = function () seen[this.text] + /*L*/" matching items";
|
context.keys.description = function () seen[this.text] + /*L*/" matching items";
|
||||||
|
context.ignoreCase = true;
|
||||||
let seen = {};
|
let seen = {};
|
||||||
context.completions = array(keys(item).join(" ").toLowerCase().split(/[()\s]+/)
|
context.completions = array(keys(item).join(" ").toLowerCase().split(/[()\s]+/)
|
||||||
for (item in params.iterate(args)))
|
for (item in params.iterate(args)))
|
||||||
.flatten().filter(function (w) /^\w[\w-_']+$/.test(w))
|
.flatten()
|
||||||
.map(function (k) {
|
.map(function (k) {
|
||||||
seen[k] = (seen[k] || 0) + 1;
|
seen[k] = (seen[k] || 0) + 1;
|
||||||
return k;
|
return k;
|
||||||
|
|||||||
Reference in New Issue
Block a user