1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-13 20:05:46 +01:00

Don't offer value completions for boolean options. Fix spellcheck highlighting of invalid option names. Closes issue #209.

This commit is contained in:
Kris Maglione
2010-12-31 21:33:44 -05:00
parent 937d7ff3af
commit 0d6e0a1d6b
4 changed files with 13 additions and 9 deletions

View File

@@ -1006,13 +1006,19 @@ var Options = Module("options", {
}
let option = opt.option;
context.advance(context.filter.indexOf("=") + 1);
if (!option) {
context.message = "No such option: " + opt.name;
context.highlight(0, name.length, "SPELLCHECK");
context.highlight(0, opt.name.length, "SPELLCHECK");
}
context.advance(context.filter.indexOf("="));
if (option.type == "boolean") {
context.message = "Trailing characters";
context.highlight(0, context.filter.length, "SPELLCHECK");
return;
}
context.advance(1);
if (opt.get || opt.reset || !option || prefix)
return null;
@@ -1230,9 +1236,7 @@ var Options = Module("options", {
let extra = {};
switch (opt.type) {
case "boolean":
if (!completer)
completer = function () [["true", ""], ["false", ""]];
break;
return;
case "regexplist":
newValues = Option.splitList(context.filter);
// Fallthrough

View File

@@ -160,7 +160,7 @@ function defineModule(name, params) {
defineModule.loadLog = [];
Object.defineProperty(defineModule.loadLog, "push", {
value: function (val) {
if (false)
if (true)
defineModule.dump(val + "\n");
this[this.length] = Date.now() + " " + val;
}