mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-28 02:25:48 +01:00
Don't block the entire Firefox process during io.system.
--HG-- extra : rebase_source : 7e3889e5bf19cdd1726fdd5c3dcdb98f4f0374f5
This commit is contained in:
@@ -1003,7 +1003,7 @@ const Dactyl = Module("dactyl", {
|
|||||||
* @param {Object} error The error object.
|
* @param {Object} error The error object.
|
||||||
*/
|
*/
|
||||||
reportError: function reportError(error, echo) {
|
reportError: function reportError(error, echo) {
|
||||||
if (error instanceof FailedAssertion) {
|
if (error instanceof FailedAssertion || error.message === "Interrupted") {
|
||||||
if (error.message)
|
if (error.message)
|
||||||
dactyl.echoerr(error.message);
|
dactyl.echoerr(error.message);
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -251,7 +251,6 @@ const Events = Module("events", {
|
|||||||
|
|
||||||
for (let [, evt_obj] in Iterator(events.fromString(keys))) {
|
for (let [, evt_obj] in Iterator(events.fromString(keys))) {
|
||||||
for (let type in values(["keydown", "keyup", "keypress"])) {
|
for (let type in values(["keydown", "keyup", "keypress"])) {
|
||||||
let elem = dactyl.focus || buffer.focusedFrame;
|
|
||||||
let evt = this.feedingEvent = update({}, evt_obj, { type: type });
|
let evt = this.feedingEvent = update({}, evt_obj, { type: type });
|
||||||
|
|
||||||
if (isObject(noremap))
|
if (isObject(noremap))
|
||||||
|
|||||||
@@ -265,7 +265,16 @@ lookup:
|
|||||||
let process = services.create("process");
|
let process = services.create("process");
|
||||||
|
|
||||||
process.init(file);
|
process.init(file);
|
||||||
process.run(blocking, args.map(String), args.length);
|
process.run(false, args.map(String), args.length);
|
||||||
|
try {
|
||||||
|
if (blocking)
|
||||||
|
while (process.isRunning)
|
||||||
|
util.threadYield(false, true);
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
process.kill();
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
|
||||||
return process.exitValue;
|
return process.exitValue;
|
||||||
},
|
},
|
||||||
@@ -588,19 +597,20 @@ lookup:
|
|||||||
if (args.bang)
|
if (args.bang)
|
||||||
arg = "!" + arg;
|
arg = "!" + arg;
|
||||||
|
|
||||||
// replaceable bang and no previous command?
|
|
||||||
dactyl.assert(!/((^|[^\\])(\\\\)*)!/.test(arg) || io._lastRunCommand,
|
|
||||||
"E34: No previous command");
|
|
||||||
|
|
||||||
// NOTE: Vim doesn't replace ! preceded by 2 or more backslashes and documents it - desirable?
|
// NOTE: Vim doesn't replace ! preceded by 2 or more backslashes and documents it - desirable?
|
||||||
// pass through a raw bang when escaped or substitute the last command
|
// pass through a raw bang when escaped or substitute the last command
|
||||||
|
|
||||||
// This is an asinine and irritating feature when we have searchable
|
// This is an asinine and irritating feature when we have searchable
|
||||||
// command-line history. --Kris
|
// command-line history. --Kris
|
||||||
if (options["banghist"])
|
if (options["banghist"]) {
|
||||||
|
// replaceable bang and no previous command?
|
||||||
|
dactyl.assert(!/((^|[^\\])(\\\\)*)!/.test(arg) || io._lastRunCommand,
|
||||||
|
"E34: No previous command");
|
||||||
|
|
||||||
arg = arg.replace(/(\\)*!/g,
|
arg = arg.replace(/(\\)*!/g,
|
||||||
function (m) /^\\(\\\\)*!$/.test(m) ? m.replace("\\!", "!") : m.replace("!", io._lastRunCommand)
|
function (m) /^\\(\\\\)*!$/.test(m) ? m.replace("\\!", "!") : m.replace("!", io._lastRunCommand)
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
io._lastRunCommand = arg;
|
io._lastRunCommand = arg;
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,10 @@ if (!Object.defineProperty)
|
|||||||
if ("value" in desc)
|
if ("value" in desc)
|
||||||
if (desc.writable && !objproto.__lookupGetter__.call(obj, prop)
|
if (desc.writable && !objproto.__lookupGetter__.call(obj, prop)
|
||||||
&& !objproto.__lookupSetter__.call(obj, prop))
|
&& !objproto.__lookupSetter__.call(obj, prop))
|
||||||
obj[prop] = value;
|
try {
|
||||||
|
obj[prop] = value;
|
||||||
|
}
|
||||||
|
catch (e if e instanceof TypeError) {}
|
||||||
else {
|
else {
|
||||||
objproto.__defineGetter__.call(obj, prop, function () value);
|
objproto.__defineGetter__.call(obj, prop, function () value);
|
||||||
if (desc.writable)
|
if (desc.writable)
|
||||||
|
|||||||
Reference in New Issue
Block a user