mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-17 21:13:31 +01:00
Ignore arg/motion maps when shorter matching map is found. Closes issue #365.
This commit is contained in:
@@ -44,12 +44,7 @@ var ProcessorStack = Class("ProcessorStack", {
|
|||||||
if (this.ownsBuffer)
|
if (this.ownsBuffer)
|
||||||
statusline.updateInputBuffer(this.processors.length ? this.buffer : "");
|
statusline.updateInputBuffer(this.processors.length ? this.buffer : "");
|
||||||
|
|
||||||
if (this.processors.length) {
|
if (!this.processors.some(function (p) !p.extended) && this.actions.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._actions.length == 0) {
|
if (this._actions.length == 0) {
|
||||||
dactyl.beep();
|
dactyl.beep();
|
||||||
events.feedingKeys = false;
|
events.feedingKeys = false;
|
||||||
@@ -60,6 +55,13 @@ var ProcessorStack = Class("ProcessorStack", {
|
|||||||
events.dbg("ACTION RES: " + res);
|
events.dbg("ACTION RES: " + res);
|
||||||
}
|
}
|
||||||
result = res === Events.PASS ? Events.PASS : Events.KILL;
|
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 &&
|
else if (result !== Events.KILL && !this.actions.length &&
|
||||||
(this.events.length > 1 ||
|
(this.events.length > 1 ||
|
||||||
@@ -98,7 +100,7 @@ var ProcessorStack = Class("ProcessorStack", {
|
|||||||
if (force && this.processors.length === 0)
|
if (force && this.processors.length === 0)
|
||||||
events.processor = null;
|
events.processor = null;
|
||||||
|
|
||||||
return this.processors.length == 0;
|
return this.processors.length === 0;
|
||||||
},
|
},
|
||||||
|
|
||||||
process: function process(event) {
|
process: function process(event) {
|
||||||
@@ -238,6 +240,8 @@ var KeyArgProcessor = Class("KeyArgProcessor", KeyProcessor, {
|
|||||||
this.wantCount = wantCount;
|
this.wantCount = wantCount;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
extended: true,
|
||||||
|
|
||||||
onKeyPress: function onKeyPress(event) {
|
onKeyPress: function onKeyPress(event) {
|
||||||
if (Events.isEscape(event))
|
if (Events.isEscape(event))
|
||||||
return Events.KILL;
|
return Events.KILL;
|
||||||
|
|||||||
@@ -627,7 +627,10 @@ function update(target) {
|
|||||||
func.supercall = function supercall(self)
|
func.supercall = function supercall(self)
|
||||||
func.superapply(self, Array.slice(arguments, 1));
|
func.superapply(self, Array.slice(arguments, 1));
|
||||||
}
|
}
|
||||||
Object.defineProperty(target, k, desc);
|
try {
|
||||||
|
Object.defineProperty(target, k, desc);
|
||||||
|
}
|
||||||
|
catch (e) {}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return target;
|
return target;
|
||||||
@@ -829,8 +832,9 @@ memoize(Class.prototype, "closure", function () {
|
|||||||
try {
|
try {
|
||||||
return fn.apply(self, arguments);
|
return fn.apply(self, arguments);
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e if !(e instanceof FailedAssertion)) {
|
||||||
util.reportError(e);
|
util.reportError(e);
|
||||||
|
throw e.stack ? e : Error(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
iter(properties(this), properties(this, true)).forEach(function (k) {
|
iter(properties(this), properties(this, true)).forEach(function (k) {
|
||||||
@@ -838,6 +842,8 @@ memoize(Class.prototype, "closure", function () {
|
|||||||
closure[k] = closure(this[k]);
|
closure[k] = closure(this[k]);
|
||||||
else if (!(k in closure))
|
else if (!(k in closure))
|
||||||
Object.defineProperty(closure, k, {
|
Object.defineProperty(closure, k, {
|
||||||
|
configurable: true,
|
||||||
|
enumerable: true,
|
||||||
get: function get_proxy() self[k],
|
get: function get_proxy() self[k],
|
||||||
set: function set_proxy(val) self[k] = val,
|
set: function set_proxy(val) self[k] = val,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user