mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-04 21:15:45 +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.
|
||||
*/
|
||||
reportError: function reportError(error, echo) {
|
||||
if (error instanceof FailedAssertion) {
|
||||
if (error instanceof FailedAssertion || error.message === "Interrupted") {
|
||||
if (error.message)
|
||||
dactyl.echoerr(error.message);
|
||||
else
|
||||
|
||||
@@ -251,7 +251,6 @@ const Events = Module("events", {
|
||||
|
||||
for (let [, evt_obj] in Iterator(events.fromString(keys))) {
|
||||
for (let type in values(["keydown", "keyup", "keypress"])) {
|
||||
let elem = dactyl.focus || buffer.focusedFrame;
|
||||
let evt = this.feedingEvent = update({}, evt_obj, { type: type });
|
||||
|
||||
if (isObject(noremap))
|
||||
|
||||
@@ -265,7 +265,16 @@ lookup:
|
||||
let process = services.create("process");
|
||||
|
||||
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;
|
||||
},
|
||||
@@ -588,19 +597,20 @@ lookup:
|
||||
if (args.bang)
|
||||
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?
|
||||
// pass through a raw bang when escaped or substitute the last command
|
||||
|
||||
// This is an asinine and irritating feature when we have searchable
|
||||
// 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,
|
||||
function (m) /^\\(\\\\)*!$/.test(m) ? m.replace("\\!", "!") : m.replace("!", io._lastRunCommand)
|
||||
);
|
||||
}
|
||||
|
||||
io._lastRunCommand = arg;
|
||||
|
||||
|
||||
@@ -38,7 +38,10 @@ if (!Object.defineProperty)
|
||||
if ("value" in desc)
|
||||
if (desc.writable && !objproto.__lookupGetter__.call(obj, prop)
|
||||
&& !objproto.__lookupSetter__.call(obj, prop))
|
||||
obj[prop] = value;
|
||||
try {
|
||||
obj[prop] = value;
|
||||
}
|
||||
catch (e if e instanceof TypeError) {}
|
||||
else {
|
||||
objproto.__defineGetter__.call(obj, prop, function () value);
|
||||
if (desc.writable)
|
||||
|
||||
Reference in New Issue
Block a user