fix BufferLine resize

This commit is contained in:
Jörg Breitbart
2018-10-09 18:56:48 +02:00
parent 8d16bb6ea2
commit 3877e96d7f
2 changed files with 32 additions and 1 deletions
+5 -1
View File
@@ -218,7 +218,11 @@ export class BufferLineTypedArray implements IBufferLine {
if (cols > this.length) {
const data = new Uint32Array(cols * CELL_SIZE);
if (this._data) {
data.set(this._data);
if (cols * CELL_SIZE < this._data.length) {
data.set(this._data.subarray(0, cols * CELL_SIZE));
} else {
data.set(this._data);
}
}
this._data = data;
for (let i = this.length; i < cols; ++i) {