mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 02:27:58 +01:00
Fix some bugs.
--HG-- branch : groups
This commit is contained in:
@@ -156,7 +156,10 @@ var Command = Class("Command", {
|
|||||||
throw FailedAssertion("E477: No ! allowed");
|
throw FailedAssertion("E477: No ! allowed");
|
||||||
|
|
||||||
return !dactyl.trapErrors(function exec() {
|
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)
|
if (this.always)
|
||||||
this.always(args, modifiers);
|
this.always(args, modifiers);
|
||||||
@@ -1339,7 +1342,7 @@ var Commands = Module("commands", {
|
|||||||
args["-description"],
|
args["-description"],
|
||||||
contexts.bindMacro(args, "-ex",
|
contexts.bindMacro(args, "-ex",
|
||||||
function makeParams(args, modifiers) ({
|
function makeParams(args, modifiers) ({
|
||||||
args: {
|
args: {
|
||||||
__proto__: args,
|
__proto__: args,
|
||||||
toString: function () this.string,
|
toString: function () this.string,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1358,7 +1358,6 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
|||||||
*/
|
*/
|
||||||
reportError: function reportError(error, echo) {
|
reportError: function reportError(error, echo) {
|
||||||
if (error instanceof FailedAssertion || error.message === "Interrupted") {
|
if (error instanceof FailedAssertion || error.message === "Interrupted") {
|
||||||
|
|
||||||
let context = contexts.context;
|
let context = contexts.context;
|
||||||
let prefix = context ? context.file + ":" + context.line + ": " : "";
|
let prefix = context ? context.file + ":" + context.line + ": " : "";
|
||||||
if (error.message && error.message.indexOf(prefix) !== 0)
|
if (error.message && error.message.indexOf(prefix) !== 0)
|
||||||
|
|||||||
@@ -55,8 +55,10 @@ var ProcessorStack = Class("ProcessorStack", {
|
|||||||
events.feedingKeys = false;
|
events.feedingKeys = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var res = this.actions[0]; callable(res);)
|
for (var res = this.actions[0]; callable(res);) {
|
||||||
res = res();
|
res = dactyl.trapErrors(res);
|
||||||
|
events.dbg("ACTION RES: " + res);
|
||||||
|
}
|
||||||
result = res === Events.PASS ? Events.PASS : Events.KILL;
|
result = res === Events.PASS ? Events.PASS : Events.KILL;
|
||||||
}
|
}
|
||||||
else if (result !== Events.KILL && !this.actions.length &&
|
else if (result !== Events.KILL && !this.actions.length &&
|
||||||
@@ -402,7 +404,7 @@ var Events = Module("events", {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this._activeMenubar = false;
|
this._activeMenubar = false;
|
||||||
this.listen(window, this, "events");
|
this.listen(window, this, "events", true);
|
||||||
|
|
||||||
dactyl.registerObserver("modeChange", function () {
|
dactyl.registerObserver("modeChange", function () {
|
||||||
delete self.processor;
|
delete self.processor;
|
||||||
|
|||||||
@@ -423,7 +423,7 @@ var Modes = Module("modes", {
|
|||||||
|
|
||||||
hidden: false,
|
hidden: false,
|
||||||
|
|
||||||
input: false,
|
input: Class.memoize(function () this.bases.length && this.bases.some(function (b) b.input)),
|
||||||
|
|
||||||
get passUnknown() this.input,
|
get passUnknown() this.input,
|
||||||
|
|
||||||
|
|||||||
@@ -165,22 +165,16 @@ var RangeFinder = Module("rangefinder", {
|
|||||||
modes: function (dactyl, modules, window) {
|
modes: function (dactyl, modules, window) {
|
||||||
const { modes } = modules;
|
const { modes } = modules;
|
||||||
modes.addMode("FIND", {
|
modes.addMode("FIND", {
|
||||||
extended: true,
|
|
||||||
description: "Find mode, active when typing search input",
|
description: "Find mode, active when typing search input",
|
||||||
bases: [modes.COMMAND_LINE],
|
bases: [modes.COMMAND_LINE],
|
||||||
input: true
|
|
||||||
});
|
});
|
||||||
modes.addMode("FIND_FORWARD", {
|
modes.addMode("FIND_FORWARD", {
|
||||||
extended: true,
|
|
||||||
description: "Forward Find mode, active when typing search input",
|
description: "Forward Find mode, active when typing search input",
|
||||||
bases: [modes.FIND],
|
bases: [modes.FIND]
|
||||||
input: true
|
|
||||||
});
|
});
|
||||||
modes.addMode("FIND_BACKWARD", {
|
modes.addMode("FIND_BACKWARD", {
|
||||||
extended: true,
|
|
||||||
description: "Backward Find mode, active when typing search input",
|
description: "Backward Find mode, active when typing search input",
|
||||||
bases: [modes.FIND],
|
bases: [modes.FIND]
|
||||||
input: true
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
commands: function (dactyl, modules, window) {
|
commands: function (dactyl, modules, window) {
|
||||||
@@ -191,7 +185,8 @@ var RangeFinder = Module("rangefinder", {
|
|||||||
{ argCount: "0" });
|
{ argCount: "0" });
|
||||||
},
|
},
|
||||||
commandline: function (dactyl, modules, window) {
|
commandline: function (dactyl, modules, window) {
|
||||||
this.CommandMode = Class("CommandFindMode", modules.CommandMode, {
|
const { rangefinder } = modules;
|
||||||
|
rangefinder.CommandMode = Class("CommandFindMode", modules.CommandMode, {
|
||||||
init: function init(mode) {
|
init: function init(mode) {
|
||||||
this.mode = mode;
|
this.mode = mode;
|
||||||
init.supercall(this);
|
init.supercall(this);
|
||||||
@@ -201,7 +196,7 @@ var RangeFinder = Module("rangefinder", {
|
|||||||
|
|
||||||
get prompt() this.mode === modules.modes.FIND_BACKWARD ? "?" : "/",
|
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 onChange() modules.rangefinder.closure.onChange,
|
||||||
get onSubmit() modules.rangefinder.closure.onSubmit
|
get onSubmit() modules.rangefinder.closure.onSubmit
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user