-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Links get re-evaluated when buffer changes happen outside viewport #4814
Copy link
Copy link
Closed
Description
Repro:
- Run ls to fill viewport
- Open vscode repo in terminal
- Echo a url
- Run ./scripts/test
- 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:
xterm.js/src/common/InputHandler.ts
Lines 498 to 499 in 1618092
| // 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:
xterm.js/src/browser/services/RenderService.ts
Lines 169 to 171 in 1618092
| if (!this._isNextRenderRedrawOnly) { | |
| this._onRenderedViewportChange.fire({ start, end }); | |
| } |
And assuming that the event is relative to ydisp:
xterm.js/src/browser/Linkifier2.ts
Lines 323 to 331 in 1618092
| 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; |
Reactions are currently unavailable