]> git.proxmox.com Git - mirror_xterm.js.git/commitdiff
Clear row and return spans before generating row
authorDaniel Imms <daimms@microsoft.com>
Wed, 4 Jan 2017 17:44:58 +0000 (09:44 -0800)
committerDaniel Imms <daimms@microsoft.com>
Wed, 4 Jan 2017 17:44:58 +0000 (09:44 -0800)
src/xterm.js

index ebfd5f20af29814293d4fb981b9cb844cf2b69f0..3d8bd8352b98f93893fd7da23578cff69cfece6e 100644 (file)
@@ -1078,8 +1078,6 @@ Terminal.prototype.refresh = function(start, end, queue) {
     end = this.rows.length - 1;
   }
 
-  var currentElement;
-
   for (; y <= end; y++) {
     row = y + this.ydisp;
 
@@ -1099,6 +1097,14 @@ Terminal.prototype.refresh = function(start, end, queue) {
 
     var documentFragment = document.createDocumentFragment();
     var innerHTML = '';
+    var currentElement;
+
+    // Return the row's spans to the pool
+    while (this.children[y].children.length) {
+      var child = this.children[y].children[0];
+      this.children[y].removeChild(child);
+      this.spanElementObjectPool.release(child);
+    }
 
     for (; i < width; i++) {
       data = line[i][0];
@@ -1263,13 +1269,6 @@ Terminal.prototype.refresh = function(start, end, queue) {
     //this.children[y].innerHTML = out;
     //this.children[y].innerHTML = '';
 
-    // Return spans to the pool
-    while (this.children[y].children.length) {
-      var child = this.children[y].children[0];
-      this.children[y].removeChild(child);
-      this.spanElementObjectPool.release(child);
-    }
-
     this.children[y].appendChild(documentFragment)
   }