From 34eb0eda79c0704164da8d0c09447743d72a3b96 Mon Sep 17 00:00:00 2001 From: Mikhail Yakimenko Date: Sat, 13 Apr 2024 13:14:34 +0200 Subject: [PATCH 1/2] Removed visual bug with link hover underlines staying after scrolling off --- src/browser/Linkifier.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/browser/Linkifier.ts b/src/browser/Linkifier.ts index ac37e42f18..6e7aab1c62 100644 --- a/src/browser/Linkifier.ts +++ b/src/browser/Linkifier.ts @@ -301,10 +301,10 @@ export class Linkifier extends Disposable implements ILinkifier2 { if (!this._currentLink) { return; } - // When start is 0 a scroll most likely occurred, make sure links above the fold also get + // When start is 0 a scroll most likely occurred, make sure links above and below the fold also get // cleared. const start = e.start === 0 ? 0 : e.start + 1 + this._bufferService.buffer.ydisp; - const end = this._bufferService.buffer.ydisp + 1 + e.end; + const end = e.start === 0 ? this._bufferService.buffer.ybase + this._bufferService.rows: this._bufferService.buffer.ydisp + 1 + e.end; // Only clear the link if the viewport change happened on this line if (this._currentLink.link.range.start.y >= start && this._currentLink.link.range.end.y <= end) { this._clearCurrentLink(start, end); From fd5ab8f00b7074b750b150839cd3b56fc40736aa Mon Sep 17 00:00:00 2001 From: Mikhail Yakimenko Date: Sun, 21 Apr 2024 18:56:57 +0200 Subject: [PATCH 2/2] Reduced comment length to adhere to linter requirements. --- src/browser/Linkifier.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/browser/Linkifier.ts b/src/browser/Linkifier.ts index 6e7aab1c62..8beb9c438a 100644 --- a/src/browser/Linkifier.ts +++ b/src/browser/Linkifier.ts @@ -301,8 +301,8 @@ export class Linkifier extends Disposable implements ILinkifier2 { if (!this._currentLink) { return; } - // When start is 0 a scroll most likely occurred, make sure links above and below the fold also get - // cleared. + // When start is 0 a scroll most likely occurred, make sure links above and below the fold + // also get cleared. const start = e.start === 0 ? 0 : e.start + 1 + this._bufferService.buffer.ydisp; const end = e.start === 0 ? this._bufferService.buffer.ybase + this._bufferService.rows: this._bufferService.buffer.ydisp + 1 + e.end; // Only clear the link if the viewport change happened on this line