@@ -195,9 +195,7 @@ export class ContentHoverController extends Disposable {
195
195
196
196
private _setCurrentResult ( hoverResult : HoverResult | null ) : void {
197
197
if ( this . _currentResult === hoverResult ) {
198
- if ( hoverResult === null && ! this . _widget . isFocused ) {
199
- this . _widget . hide ( ) ;
200
- }
198
+ // avoid updating the DOM to avoid resetting the user selection
201
199
return ;
202
200
}
203
201
if ( hoverResult && hoverResult . messages . length === 0 ) {
@@ -207,9 +205,6 @@ export class ContentHoverController extends Disposable {
207
205
if ( this . _currentResult ) {
208
206
this . _renderMessages ( this . _currentResult . anchor , this . _currentResult . messages ) ;
209
207
} else {
210
- if ( this . _widget . isFocused ) {
211
- return ;
212
- }
213
208
this . _widget . hide ( ) ;
214
209
}
215
210
}
@@ -232,6 +227,10 @@ export class ContentHoverController extends Disposable {
232
227
return this . _widget . isVisible ;
233
228
}
234
229
230
+ public isFocused ( ) : boolean {
231
+ return this . _widget . isFocused ;
232
+ }
233
+
235
234
public containsNode ( node : Node | null | undefined ) : boolean {
236
235
return ( node ? this . _widget . getDomNode ( ) . contains ( node ) : false ) ;
237
236
}
@@ -264,7 +263,9 @@ export class ContentHoverController extends Disposable {
264
263
return ;
265
264
}
266
265
}
267
-
266
+ if ( hoverResult . messages . length === 0 && this . _widget . isFocused ) {
267
+ return ;
268
+ }
268
269
this . _setCurrentResult ( hoverResult ) ;
269
270
}
270
271
@@ -735,7 +736,10 @@ export class ContentHoverWidget extends ResizableContentWidget {
735
736
}
736
737
737
738
public hide ( ) : void {
738
- const stoleFocus = this . _visibleData ?. stoleFocus || this . _hoverFocusedKey . get ( ) ;
739
+ if ( ! this . _visibleData ) {
740
+ return ;
741
+ }
742
+ const stoleFocus = this . _visibleData . stoleFocus || this . _hoverFocusedKey . get ( ) ;
739
743
this . _setHoverData ( undefined ) ;
740
744
this . _resizableNode . maxSize = new dom . Dimension ( Infinity , Infinity ) ;
741
745
this . _resizableNode . clearSashHoverState ( ) ;
0 commit comments