1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-07 23:04:17 +01:00

Ignore arg/motion maps when shorter matching map is found. Closes issue #365.

This commit is contained in:
Kris Maglione
2011-02-12 19:52:53 -05:00
parent bc953c5d9b
commit 61476fca47
2 changed files with 19 additions and 9 deletions

View File

@@ -44,12 +44,7 @@ var ProcessorStack = Class("ProcessorStack", {
if (this.ownsBuffer)
statusline.updateInputBuffer(this.processors.length ? this.buffer : "");
if (this.processors.length) {
result = Events.KILL;
if (this.actions.length && options["timeout"])
this.timer = services.Timer(this, options["timeoutlen"], services.Timer.TYPE_ONE_SHOT);
}
else if (this.actions.length) {
if (!this.processors.some(function (p) !p.extended) && this.actions.length) {
if (this._actions.length == 0) {
dactyl.beep();
events.feedingKeys = false;
@@ -60,6 +55,13 @@ var ProcessorStack = Class("ProcessorStack", {
events.dbg("ACTION RES: " + res);
}
result = res === Events.PASS ? Events.PASS : Events.KILL;
if (res !== Events.PASS)
this.processors.length = 0;
}
else if (this.processors.length) {
result = Events.KILL;
if (this.actions.length && options["timeout"])
this.timer = services.Timer(this, options["timeoutlen"], services.Timer.TYPE_ONE_SHOT);
}
else if (result !== Events.KILL && !this.actions.length &&
(this.events.length > 1 ||
@@ -98,7 +100,7 @@ var ProcessorStack = Class("ProcessorStack", {
if (force && this.processors.length === 0)
events.processor = null;
return this.processors.length == 0;
return this.processors.length === 0;
},
process: function process(event) {
@@ -238,6 +240,8 @@ var KeyArgProcessor = Class("KeyArgProcessor", KeyProcessor, {
this.wantCount = wantCount;
},
extended: true,
onKeyPress: function onKeyPress(event) {
if (Events.isEscape(event))
return Events.KILL;

View File

@@ -627,7 +627,10 @@ function update(target) {
func.supercall = function supercall(self)
func.superapply(self, Array.slice(arguments, 1));
}
Object.defineProperty(target, k, desc);
try {
Object.defineProperty(target, k, desc);
}
catch (e) {}
});
}
return target;
@@ -829,8 +832,9 @@ memoize(Class.prototype, "closure", function () {
try {
return fn.apply(self, arguments);
}
catch (e) {
catch (e if !(e instanceof FailedAssertion)) {
util.reportError(e);
throw e.stack ? e : Error(e);
}
}
iter(properties(this), properties(this, true)).forEach(function (k) {
@@ -838,6 +842,8 @@ memoize(Class.prototype, "closure", function () {
closure[k] = closure(this[k]);
else if (!(k in closure))
Object.defineProperty(closure, k, {
configurable: true,
enumerable: true,
get: function get_proxy() self[k],
set: function set_proxy(val) self[k] = val,
});