mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 05:37:58 +01:00
Update :extensions with live update and buttons like :downloads. Rename to :addons.
--HG-- branch : key-processing
This commit is contained in:
@@ -1188,17 +1188,19 @@ var CommandLine = Module("commandline", {
|
||||
},
|
||||
|
||||
withOutputToString: function (fn, self) {
|
||||
let buffer = [];
|
||||
dactyl.registerObserver("echoLine", observe, true);
|
||||
dactyl.registerObserver("echoMultiline", observe, true);
|
||||
|
||||
let output = [];
|
||||
function observe(str, highlight, dom) {
|
||||
buffer.push(dom && !isString(str) ? util.domToString(dom) : str);
|
||||
output.push(dom && !isString(str) ? dom : str);
|
||||
}
|
||||
|
||||
this.savingOutput = true;
|
||||
dactyl.trapErrors.apply(dactyl, [fn, self].concat(Array.slice(arguments, 2)));
|
||||
this.savingOutput = false;
|
||||
return buffer.join("\n");
|
||||
return output.map(function (elem) elem instanceof Node ? util.domToString(elem) : elem)
|
||||
.join("\n");
|
||||
}
|
||||
}, {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user