Skip to content

Links get re-evaluated when buffer changes happen outside viewport #4814

@Tyriar

Description

@Tyriar

Repro:

  1. Run ls to fill viewport
  2. Open vscode repo in terminal
  3. Echo a url
  4. Run ./scripts/test
  5. Scroll up while that's running and hover the url, the underline will flicker

The issue is confusion between requesting re-rendering of dirty rows relative to ybase:

// Refresh any dirty rows accumulated as part of parsing
this._onRequestRefreshRows.fire(this._dirtyRowTracker.start, this._dirtyRowTracker.end);

Then incorrectly firing onRenderedViewportChange incorrectly even when the viewport isn't re-rendered when scrolled up:

if (!this._isNextRenderRedrawOnly) {
this._onRenderedViewportChange.fire({ start, end });
}

And assuming that the event is relative to ydisp:

this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(e => {
// Sanity check, this shouldn't happen in practice as this listener would be disposed
if (!this._currentLink) {
return;
}
// 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;
const end = this._bufferService.buffer.ydisp + 1 + e.end;

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions