summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKris Maglione <maglione.k@gmail.com>2011-02-07 18:34:48 -0500
committerKris Maglione <maglione.k@gmail.com>2011-02-07 18:34:48 -0500
commitee03cbd2ce56b0f00f44c2a461adbd300c1ff943 (patch)
tree91b3ba5fa29ca12dc99fed7e1e0986fe9368980f
parenta94832ef1576c691b1703b0fc7b0ecbe3b068022 (diff)
downloadpentadactyl-ee03cbd2ce56b0f00f44c2a461adbd300c1ff943.tar.gz
Fix some bugs.
--HG-- branch : groups
-rw-r--r--common/content/commands.js7
-rw-r--r--common/content/dactyl.js1
-rw-r--r--common/content/events.js8
-rw-r--r--common/content/modes.js2
-rw-r--r--common/modules/finder.jsm15
5 files changed, 16 insertions, 17 deletions
diff --git a/common/content/commands.js b/common/content/commands.js
index 9f90d21d..7d67ecd0 100644
--- a/common/content/commands.js
+++ b/common/content/commands.js
@@ -156,7 +156,10 @@ var Command = Class("Command", {
throw FailedAssertion("E477: No ! allowed");
return !dactyl.trapErrors(function exec() {
- update({}, this.hive.argsExtra(args), args);
+ let extra = this.hive.argsExtra(args);
+ for (let k in properties(extra))
+ if (!(k in args))
+ Object.defineProperty(args, k, Object.getOwnPropertyDescriptor(extra, k));
if (this.always)
this.always(args, modifiers);
@@ -1339,7 +1342,7 @@ var Commands = Module("commands", {
args["-description"],
contexts.bindMacro(args, "-ex",
function makeParams(args, modifiers) ({
- args: {
+ args: {
__proto__: args,
toString: function () this.string,
},
diff --git a/common/content/dactyl.js b/common/content/dactyl.js
index 70488de8..88156d0d 100644
--- a/common/content/dactyl.js
+++ b/common/content/dactyl.js
@@ -1358,7 +1358,6 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
*/
reportError: function reportError(error, echo) {
if (error instanceof FailedAssertion || error.message === "Interrupted") {
-
let context = contexts.context;
let prefix = context ? context.file + ":" + context.line + ": " : "";
if (error.message && error.message.indexOf(prefix) !== 0)
diff --git a/common/content/events.js b/common/content/events.js
index aaa81b63..46e8775a 100644
--- a/common/content/events.js
+++ b/common/content/events.js
@@ -55,8 +55,10 @@ var ProcessorStack = Class("ProcessorStack", {
events.feedingKeys = false;
}
- for (var res = this.actions[0]; callable(res);)
- res = res();
+ for (var res = this.actions[0]; callable(res);) {
+ res = dactyl.trapErrors(res);
+ events.dbg("ACTION RES: " + res);
+ }
result = res === Events.PASS ? Events.PASS : Events.KILL;
}
else if (result !== Events.KILL && !this.actions.length &&
@@ -402,7 +404,7 @@ var Events = Module("events", {
}
this._activeMenubar = false;
- this.listen(window, this, "events");
+ this.listen(window, this, "events", true);
dactyl.registerObserver("modeChange", function () {
delete self.processor;
diff --git a/common/content/modes.js b/common/content/modes.js
index 3b2ca4a3..b9ce2fc9 100644
--- a/common/content/modes.js
+++ b/common/content/modes.js
@@ -423,7 +423,7 @@ var Modes = Module("modes", {
hidden: false,
- input: false,
+ input: Class.memoize(function () this.bases.length && this.bases.some(function (b) b.input)),
get passUnknown() this.input,
diff --git a/common/modules/finder.jsm b/common/modules/finder.jsm
index 1e959f27..b5c0693e 100644
--- a/common/modules/finder.jsm
+++ b/common/modules/finder.jsm
@@ -165,22 +165,16 @@ var RangeFinder = Module("rangefinder", {
modes: function (dactyl, modules, window) {
const { modes } = modules;
modes.addMode("FIND", {
- extended: true,
description: "Find mode, active when typing search input",
bases: [modes.COMMAND_LINE],
- input: true
});
modes.addMode("FIND_FORWARD", {
- extended: true,
description: "Forward Find mode, active when typing search input",
- bases: [modes.FIND],
- input: true
+ bases: [modes.FIND]
});
modes.addMode("FIND_BACKWARD", {
- extended: true,
description: "Backward Find mode, active when typing search input",
- bases: [modes.FIND],
- input: true
+ bases: [modes.FIND]
});
},
commands: function (dactyl, modules, window) {
@@ -191,7 +185,8 @@ var RangeFinder = Module("rangefinder", {
{ argCount: "0" });
},
commandline: function (dactyl, modules, window) {
- this.CommandMode = Class("CommandFindMode", modules.CommandMode, {
+ const { rangefinder } = modules;
+ rangefinder.CommandMode = Class("CommandFindMode", modules.CommandMode, {
init: function init(mode) {
this.mode = mode;
init.supercall(this);
@@ -201,7 +196,7 @@ var RangeFinder = Module("rangefinder", {
get prompt() this.mode === modules.modes.FIND_BACKWARD ? "?" : "/",
- get onCancel() modules.rangefinder.closure.onCancel,
+ get onCancel() rangefinder.closure.onCancel,
get onChange() modules.rangefinder.closure.onChange,
get onSubmit() modules.rangefinder.closure.onSubmit
});