mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 18:57:58 +01:00
Make :yank :extensions work as expected.
This commit is contained in:
@@ -1215,7 +1215,9 @@ var CommandLine = Module("commandline", {
|
||||
function observe(str, highlight, dom) {
|
||||
buffer.push(dom && !isString(str) ? util.domToString(dom) : str);
|
||||
}
|
||||
this.savingOutput = true;
|
||||
dactyl.trapErrors.apply(dactyl, [fn, self].concat(Array.slice(arguments, 2)));
|
||||
this.savingOutput = false;
|
||||
return buffer.join("\n");
|
||||
}
|
||||
}, {
|
||||
|
||||
@@ -1804,6 +1804,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
||||
 on restart)</>;
|
||||
return <></>;
|
||||
}
|
||||
let waiting = true;
|
||||
AddonManager.getAddonsByTypes(["extension"], function (extensions) {
|
||||
if (args[0])
|
||||
extensions = extensions.filter(function (extension) extension.name.indexOf(args[0]) >= 0);
|
||||
@@ -1823,7 +1824,10 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
||||
dactyl.echoerr("Exxx: No extension matching " + filter.quote());
|
||||
else
|
||||
dactyl.echoerr("No extensions installed");
|
||||
waiting = false;
|
||||
});
|
||||
if (commandline.savingOutput)
|
||||
util.waitFor(function () !waiting);
|
||||
},
|
||||
{ argCount: "?" });
|
||||
|
||||
|
||||
@@ -803,8 +803,8 @@ var CompletionContext = Class("CompletionContext", {
|
||||
*/
|
||||
wait: function wait(interruptable, timeout) {
|
||||
let end = Date.now() + timeout;
|
||||
while (this.incomplete && (!timeout || Date.now() > end))
|
||||
util.threadYield(false, interruptable);
|
||||
util.waitFor(function () !this.incomplete || (this.timeout && Date.now() > end),
|
||||
this);
|
||||
return this.incomplete;
|
||||
}
|
||||
}, {
|
||||
|
||||
@@ -1507,6 +1507,10 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
||||
this.yielders--;
|
||||
}
|
||||
},
|
||||
waitFor: function waitFor(test, self, interruptable) {
|
||||
while (!test.call(self))
|
||||
this.threadYield(false, interruptable);
|
||||
},
|
||||
|
||||
yieldable: function yieldable(func)
|
||||
function magic() {
|
||||
|
||||
Reference in New Issue
Block a user