fix trimmedLength for TypedArray

This commit is contained in:
Jörg Breitbart
2018-10-31 14:26:54 +01:00
parent ee6fa6ca00
commit 62f1d64af4
+1 -1
View File
@@ -304,7 +304,7 @@ export class BufferLineTypedArray implements IBufferLine {
public getTrimmedLength(): number {
for (let i = this.length - 1; i >= 0; --i) {
if (this._data[i * CELL_SIZE + Cell.STRING] !== 0) { // 0 ==> ''.charCodeAt(0) ==> NaN ==> 0
return i + 1;
return i + this._data[i * CELL_SIZE + Cell.WIDTH] - 1;
}
}
return 0;