@@ -23,6 +23,7 @@ export class Linkifier2 extends Disposable implements ILinkifier2 {
2323 private _linkCacheDisposables : IDisposable [ ] = [ ] ;
2424 private _lastBufferCell : IBufferCellPosition | undefined ;
2525 private _isMouseOut : boolean = true ;
26+ private _wasResized : boolean = false ;
2627 private _activeProviderReplies : Map < Number , ILinkWithState [ ] | undefined > | undefined ;
2728 private _activeLine : number = - 1 ;
2829
@@ -39,6 +40,11 @@ export class Linkifier2 extends Disposable implements ILinkifier2 {
3940 this . register ( toDisposable ( ( ) => {
4041 this . _lastMouseEvent = undefined ;
4142 } ) ) ;
43+ // Listen to resize to catch the case where it's resized and the cursor is out of the viewport.
44+ this . register ( this . _bufferService . onResize ( ( ) => {
45+ this . _clearCurrentLink ( ) ;
46+ this . _wasResized = true ;
47+ } ) ) ;
4248 }
4349
4450 public registerLinkProvider ( linkProvider : ILinkProvider ) : IDisposable {
@@ -105,9 +111,10 @@ export class Linkifier2 extends Disposable implements ILinkifier2 {
105111 private _handleHover ( position : IBufferCellPosition ) : void {
106112 // TODO: This currently does not cache link provider results across wrapped lines, activeLine should be something like `activeRange: {startY, endY}`
107113 // Check if we need to clear the link
108- if ( this . _activeLine !== position . y ) {
114+ if ( this . _activeLine !== position . y || this . _wasResized ) {
109115 this . _clearCurrentLink ( ) ;
110116 this . _askForLink ( position , false ) ;
117+ this . _wasResized = false ;
111118 return ;
112119 }
113120
0 commit comments