From 62f1d64af4c7a1eea239309867ca890426be3273 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Breitbart?= Date: Wed, 31 Oct 2018 14:26:54 +0100 Subject: [PATCH] fix trimmedLength for TypedArray --- src/BufferLine.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BufferLine.ts b/src/BufferLine.ts index e1cb6a4f..54207142 100644 --- a/src/BufferLine.ts +++ b/src/BufferLine.ts @@ -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;