From 22aaf0471a0911ec3c0158636dc1bdb199a1430f Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Sat, 25 Apr 2020 06:41:25 -0700 Subject: [PATCH] Invalidate all links above when the terminal scrolls See microsoft/vscode#95556 --- src/browser/Linkifier2.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/browser/Linkifier2.ts b/src/browser/Linkifier2.ts index a21f7621..bcdbffe6 100644 --- a/src/browser/Linkifier2.ts +++ b/src/browser/Linkifier2.ts @@ -237,7 +237,10 @@ export class Linkifier2 implements ILinkifier2 { // Add listener for rerendering if (this._renderService) { this._linkCacheDisposables.push(this._renderService.onRenderedBufferChange(e => { - this._clearCurrentLink(e.start + 1 + this._bufferService.buffer.ydisp, e.end + 1 + this._bufferService.buffer.ydisp); + // When start is 0 a scroll most likely occurred, make sure links above the fold also get + // cleared. + const start = e.start === 0 ? 0 : e.start + 1 + this._bufferService.buffer.ydisp; + this._clearCurrentLink(start, e.end + 1 + this._bufferService.buffer.ydisp); })); } }