1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-03-27 13:23:31 +01:00

Remove the command Args dependency from a few straggling completers.

--HG--
extra : rebase_source : 12e642050a248dc0a33164d6757e925c9339a760
This commit is contained in:
Doug Kearns
2010-11-09 22:19:02 +11:00
parent 6bf82c4fbc
commit ab9b65a712
7 changed files with 37 additions and 40 deletions

View File

@@ -215,12 +215,9 @@ const Abbreviations = Module("abbreviations", {
}, {
}, {
completion: function () {
// TODO: shouldn't all of these have a standard signature (context, args, ...)? --djk
completion.abbreviation = function abbreviation(context, args, modes) {
if (args.completeArg == 0) {
let abbrevs = abbreviations.merged.filter(function (abbr) abbr.inModes(modes));
context.completions = [[abbr.lhs, abbr.rhs] for ([, abbr] in Iterator(abbrevs))];
}
completion.abbreviation = function abbreviation(context, modes) {
let abbrevs = abbreviations.merged.filter(function (abbr) abbr.inModes(modes));
context.completions = [[abbr.lhs, abbr.rhs] for ([, abbr] in Iterator(abbrevs))];
};
},
@@ -252,7 +249,7 @@ const Abbreviations = Module("abbreviations", {
],
completer: function (context, args) {
if (args.length == 1)
return completion.abbreviation(context, args, modes);
return completion.abbreviation(context, modes);
else if (args["-javascript"])
return completion.javascript(context);
},
@@ -279,7 +276,7 @@ const Abbreviations = Module("abbreviations", {
return dactyl.echoerr("E24: No such abbreviation");
}, {
argCount: "1",
completer: function (context, args) completion.abbreviation(context, args, modes),
completer: function (context) completion.abbreviation(context, modes),
literal: 0
});