@@ -155,6 +155,10 @@ export class ModesHoverController implements IEditorContribution {
155
155
private _onEditorMouseMove ( mouseEvent : IEditorMouseEvent ) : void {
156
156
const target = mouseEvent . target ;
157
157
158
+ if ( this . _contentWidget ?. isFocused || this . _contentWidget ?. isResizing ) {
159
+ return ;
160
+ }
161
+
158
162
if ( this . _isMouseDown && this . _hoverClicked ) {
159
163
return ;
160
164
}
@@ -171,7 +175,7 @@ export class ModesHoverController implements IEditorContribution {
171
175
172
176
if (
173
177
! this . _isHoverSticky && target . type === MouseTargetType . CONTENT_WIDGET && target . detail === ContentHoverWidget . ID
174
- && this . _contentWidget ?. isColorPickerVisible ( )
178
+ && this . _contentWidget ?. isColorPickerVisible
175
179
) {
176
180
// though the hover is not sticky, the color picker needs to.
177
181
return ;
@@ -182,7 +186,7 @@ export class ModesHoverController implements IEditorContribution {
182
186
return ;
183
187
}
184
188
185
- if ( this . _isHoverSticky && this . _contentWidget ?. isVisibleFromKeyboard ( ) ) {
189
+ if ( this . _isHoverSticky && this . _contentWidget ?. isVisibleFromKeyboard ) {
186
190
// Sticky mode is on and the hover has been shown via keyboard
187
191
// so moving the mouse has no effect
188
192
return ;
@@ -216,9 +220,10 @@ export class ModesHoverController implements IEditorContribution {
216
220
this . _glyphWidget . startShowingAt ( target . position . lineNumber ) ;
217
221
return ;
218
222
}
219
- if ( ! this . _contentWidget ?. widget . isResizing && ! _sticky ) {
220
- this . _hideWidgets ( ) ;
223
+ if ( _sticky ) {
224
+ return ;
221
225
}
226
+ this . _hideWidgets ( ) ;
222
227
}
223
228
224
229
private _onKeyDown ( e : IKeyboardEvent ) : void {
@@ -228,7 +233,7 @@ export class ModesHoverController implements IEditorContribution {
228
233
229
234
const resolvedKeyboardEvent = this . _keybindingService . softDispatch ( e , this . _editor . getDomNode ( ) ) ;
230
235
// If the beginning of a multi-chord keybinding is pressed, or the command aims to focus the hover, set the variable to true, otherwise false
231
- const mightTriggerFocus = ( resolvedKeyboardEvent . kind === ResultKind . MoreChordsNeeded || ( resolvedKeyboardEvent . kind === ResultKind . KbFound && resolvedKeyboardEvent . commandId === 'editor.action.showHover' && this . _contentWidget ?. isVisible ( ) ) ) ;
236
+ const mightTriggerFocus = ( resolvedKeyboardEvent . kind === ResultKind . MoreChordsNeeded || ( resolvedKeyboardEvent . kind === ResultKind . KbFound && resolvedKeyboardEvent . commandId === 'editor.action.showHover' && this . _contentWidget ?. isVisible ) ) ;
232
237
233
238
if ( e . keyCode !== KeyCode . Ctrl && e . keyCode !== KeyCode . Alt && e . keyCode !== KeyCode . Meta && e . keyCode !== KeyCode . Shift
234
239
&& ! mightTriggerFocus ) {
@@ -241,7 +246,7 @@ export class ModesHoverController implements IEditorContribution {
241
246
if ( _sticky ) {
242
247
return ;
243
248
}
244
- if ( ( this . _isMouseDown && this . _hoverClicked && this . _contentWidget ?. isColorPickerVisible ( ) ) || InlineSuggestionHintsContentWidget . dropDownVisible ) {
249
+ if ( ( this . _isMouseDown && this . _hoverClicked && this . _contentWidget ?. isColorPickerVisible ) || InlineSuggestionHintsContentWidget . dropDownVisible ) {
245
250
return ;
246
251
}
247
252
this . _hoverActivatedByColorDecoratorClick = false ;
@@ -257,10 +262,6 @@ export class ModesHoverController implements IEditorContribution {
257
262
return this . _contentWidget ;
258
263
}
259
264
260
- public isColorPickerVisible ( ) : boolean {
261
- return this . _contentWidget ?. isColorPickerVisible ( ) || false ;
262
- }
263
-
264
265
public showContentHover ( range : Range , mode : HoverStartMode , source : HoverStartSource , focus : boolean , activatedByColorDecoratorClick : boolean = false ) : void {
265
266
this . _hoverActivatedByColorDecoratorClick = activatedByColorDecoratorClick ;
266
267
this . _getOrCreateContentWidget ( ) . startShowingAtRange ( range , mode , source , focus ) ;
@@ -302,8 +303,12 @@ export class ModesHoverController implements IEditorContribution {
302
303
this . _contentWidget ?. goToBottom ( ) ;
303
304
}
304
305
305
- public isHoverVisible ( ) : boolean | undefined {
306
- return this . _contentWidget ?. isVisible ( ) ;
306
+ public get isColorPickerVisible ( ) : boolean | undefined {
307
+ return this . _contentWidget ?. isColorPickerVisible ;
308
+ }
309
+
310
+ public get isHoverVisible ( ) : boolean | undefined {
311
+ return this . _contentWidget ?. isVisible ;
307
312
}
308
313
309
314
public dispose ( ) : void {
@@ -367,7 +372,7 @@ class ShowOrFocusHoverAction extends EditorAction {
367
372
const range = new Range ( position . lineNumber , position . column , position . lineNumber , position . column ) ;
368
373
const focus = editor . getOption ( EditorOption . accessibilitySupport ) === AccessibilitySupport . Enabled || ! ! args ?. focus ;
369
374
370
- if ( controller . isHoverVisible ( ) ) {
375
+ if ( controller . isHoverVisible ) {
371
376
controller . focus ( ) ;
372
377
} else {
373
378
controller . showContentHover ( range , HoverStartMode . Immediate , HoverStartSource . Keyboard , focus ) ;
0 commit comments