1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 21:57:59 +01:00

Fix some bugs.

--HG--
branch : groups
This commit is contained in:
Kris Maglione
2011-02-07 18:34:48 -05:00
parent a94832ef15
commit ee03cbd2ce
5 changed files with 16 additions and 17 deletions

View File

@@ -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,
},

View File

@@ -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)

View File

@@ -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;

View File

@@ -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,

View File

@@ -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
});