mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Request links after viewport resize
This clears the underline when hovering the link but this is an edge case that isn't so important. As it's difficult to do outside of the demo. Fixes #4357
This commit is contained in:
@@ -23,6 +23,7 @@ export class Linkifier2 extends Disposable implements ILinkifier2 {
|
||||
private _linkCacheDisposables: IDisposable[] = [];
|
||||
private _lastBufferCell: IBufferCellPosition | undefined;
|
||||
private _isMouseOut: boolean = true;
|
||||
private _wasResized: boolean = false;
|
||||
private _activeProviderReplies: Map<Number, ILinkWithState[] | undefined> | undefined;
|
||||
private _activeLine: number = -1;
|
||||
|
||||
@@ -39,6 +40,11 @@ export class Linkifier2 extends Disposable implements ILinkifier2 {
|
||||
this.register(toDisposable(() => {
|
||||
this._lastMouseEvent = undefined;
|
||||
}));
|
||||
// Listen to resize to catch the case where it's resized and the cursor is out of the viewport.
|
||||
this.register(this._bufferService.onResize(() => {
|
||||
this._clearCurrentLink();
|
||||
this._wasResized = true;
|
||||
}));
|
||||
}
|
||||
|
||||
public registerLinkProvider(linkProvider: ILinkProvider): IDisposable {
|
||||
@@ -105,9 +111,10 @@ export class Linkifier2 extends Disposable implements ILinkifier2 {
|
||||
private _handleHover(position: IBufferCellPosition): void {
|
||||
// TODO: This currently does not cache link provider results across wrapped lines, activeLine should be something like `activeRange: {startY, endY}`
|
||||
// Check if we need to clear the link
|
||||
if (this._activeLine !== position.y) {
|
||||
if (this._activeLine !== position.y || this._wasResized) {
|
||||
this._clearCurrentLink();
|
||||
this._askForLink(position, false);
|
||||
this._wasResized = false;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user