mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 09:37:58 +01:00
Fix horrible performance problems with multiple MOW echoes.
--HG-- branch : groups
This commit is contained in:
@@ -9,6 +9,8 @@
|
|||||||
var MOW = Module("mow", {
|
var MOW = Module("mow", {
|
||||||
init: function () {
|
init: function () {
|
||||||
|
|
||||||
|
this._resize = Timer(20, 400, function (force) { this.resize(force) }, this);
|
||||||
|
|
||||||
let fontSize = util.computedStyle(document.documentElement).fontSize;
|
let fontSize = util.computedStyle(document.documentElement).fontSize;
|
||||||
styles.system.add("font-size", "dactyl://content/buffer.xhtml",
|
styles.system.add("font-size", "dactyl://content/buffer.xhtml",
|
||||||
"body { font-size: " + fontSize + "; } \
|
"body { font-size: " + fontSize + "; } \
|
||||||
@@ -112,8 +114,7 @@ var MOW = Module("mow", {
|
|||||||
// that don't generate output are executed
|
// that don't generate output are executed
|
||||||
if (this.widgets.mowContainer.collapsed) {
|
if (this.widgets.mowContainer.collapsed) {
|
||||||
this.body.scrollTop = 0;
|
this.body.scrollTop = 0;
|
||||||
while (body.firstChild)
|
body.textContent = "";
|
||||||
body.removeChild(body.firstChild);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
body.appendChild(output);
|
body.appendChild(output);
|
||||||
@@ -122,7 +123,7 @@ var MOW = Module("mow", {
|
|||||||
if (!silent)
|
if (!silent)
|
||||||
dactyl.triggerObserver("echoMultiline", data, highlightGroup, output);
|
dactyl.triggerObserver("echoMultiline", data, highlightGroup, output);
|
||||||
|
|
||||||
this.resize(true);
|
this._resize.tell(true);
|
||||||
|
|
||||||
if (options["more"] && this.isScrollable(1)) {
|
if (options["more"] && this.isScrollable(1)) {
|
||||||
// start the last executed command's output at the top of the screen
|
// start the last executed command's output at the top of the screen
|
||||||
|
|||||||
Reference in New Issue
Block a user