Don't resize when unnecessary

This commit is contained in:
Daniel Imms
2016-06-08 17:38:34 -07:00
parent 637c2eae43
commit e721bdc9f0
+6 -2
View File
@@ -2585,6 +2585,10 @@
, j
, ch;
if (x === this.cols && y === this.rows) {
return;
}
if (x < 1) x = 1;
if (y < 1) y = 1;
@@ -2598,7 +2602,7 @@
this.lines[i].push(ch);
}
}
} else if (j > x) {
} else { // (j > x)
i = this.lines.length;
while (i--) {
while (this.lines[i].length > x) {
@@ -2621,7 +2625,7 @@
this.insertRow();
}
}
} else if (j > y) {
} else { // (j > y)
while (j-- > y) {
if (this.lines.length > y + this.ybase) {
this.lines.shift();