From 59be054ca167d6995b9504d6dafe5abccadc99c3 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Thu, 8 Mar 2018 11:12:59 -0800 Subject: [PATCH] Fix exception for links on bottom line --- src/Linkifier.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Linkifier.ts b/src/Linkifier.ts index 1ec53315..349ecb07 100644 --- a/src/Linkifier.ts +++ b/src/Linkifier.ts @@ -169,11 +169,10 @@ export class Linkifier extends EventEmitter implements ILinkifier { let text = this._terminal.buffer.translateBufferLineToString(absoluteRowIndex, false); // Construct full unwrapped line text - if (absoluteRowIndex + 1 < this._terminal.buffer.lines.length) { - let currentIndex = absoluteRowIndex + 1; - while ((this._terminal.buffer.lines.get(currentIndex)).isWrapped) { - text += this._terminal.buffer.translateBufferLineToString(currentIndex++, false); - } + let currentIndex = absoluteRowIndex + 1; + while (currentIndex < this._terminal.buffer.lines.length && + (this._terminal.buffer.lines.get(currentIndex)).isWrapped) { + text += this._terminal.buffer.translateBufferLineToString(currentIndex++, false); } for (let i = 0; i < this._linkMatchers.length; i++) {