Skip to content

Commit 8d77b1a

Browse files
authored
Merge pull request #2869 from Tyriar/vs95556
Invalidate all links above when the terminal scrolls
2 parents 2f98496 + 603c68b commit 8d77b1a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/browser/Linkifier2.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,10 @@ export class Linkifier2 implements ILinkifier2 {
237237
// Add listener for rerendering
238238
if (this._renderService) {
239239
this._linkCacheDisposables.push(this._renderService.onRenderedBufferChange(e => {
240-
this._clearCurrentLink(e.start + 1 + this._bufferService.buffer.ydisp, e.end + 1 + this._bufferService.buffer.ydisp);
240+
// When start is 0 a scroll most likely occurred, make sure links above the fold also get
241+
// cleared.
242+
const start = e.start === 0 ? 0 : e.start + 1 + this._bufferService.buffer.ydisp;
243+
this._clearCurrentLink(start, e.end + 1 + this._bufferService.buffer.ydisp);
241244
}));
242245
}
243246
}

0 commit comments

Comments
 (0)