@@ -155,6 +155,10 @@ export class ModesHoverController implements IEditorContribution {
155155 private _onEditorMouseMove ( mouseEvent : IEditorMouseEvent ) : void {
156156 const target = mouseEvent . target ;
157157
158+ if ( this . _contentWidget ?. isFocused || this . _contentWidget ?. isResizing ) {
159+ return ;
160+ }
161+
158162 if ( this . _isMouseDown && this . _hoverClicked ) {
159163 return ;
160164 }
@@ -171,7 +175,7 @@ export class ModesHoverController implements IEditorContribution {
171175
172176 if (
173177 ! this . _isHoverSticky && target . type === MouseTargetType . CONTENT_WIDGET && target . detail === ContentHoverWidget . ID
174- && this . _contentWidget ?. isColorPickerVisible ( )
178+ && this . _contentWidget ?. isColorPickerVisible
175179 ) {
176180 // though the hover is not sticky, the color picker needs to.
177181 return ;
@@ -182,7 +186,7 @@ export class ModesHoverController implements IEditorContribution {
182186 return ;
183187 }
184188
185- if ( this . _isHoverSticky && this . _contentWidget ?. isVisibleFromKeyboard ( ) ) {
189+ if ( this . _isHoverSticky && this . _contentWidget ?. isVisibleFromKeyboard ) {
186190 // Sticky mode is on and the hover has been shown via keyboard
187191 // so moving the mouse has no effect
188192 return ;
@@ -216,9 +220,10 @@ export class ModesHoverController implements IEditorContribution {
216220 this . _glyphWidget . startShowingAt ( target . position . lineNumber ) ;
217221 return ;
218222 }
219- if ( ! this . _contentWidget ?. widget . isResizing && ! _sticky ) {
220- this . _hideWidgets ( ) ;
223+ if ( _sticky ) {
224+ return ;
221225 }
226+ this . _hideWidgets ( ) ;
222227 }
223228
224229 private _onKeyDown ( e : IKeyboardEvent ) : void {
@@ -228,7 +233,7 @@ export class ModesHoverController implements IEditorContribution {
228233
229234 const resolvedKeyboardEvent = this . _keybindingService . softDispatch ( e , this . _editor . getDomNode ( ) ) ;
230235 // 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 ) ) ;
232237
233238 if ( e . keyCode !== KeyCode . Ctrl && e . keyCode !== KeyCode . Alt && e . keyCode !== KeyCode . Meta && e . keyCode !== KeyCode . Shift
234239 && ! mightTriggerFocus ) {
@@ -241,7 +246,7 @@ export class ModesHoverController implements IEditorContribution {
241246 if ( _sticky ) {
242247 return ;
243248 }
244- if ( ( this . _isMouseDown && this . _hoverClicked && this . _contentWidget ?. isColorPickerVisible ( ) ) || InlineSuggestionHintsContentWidget . dropDownVisible ) {
249+ if ( ( this . _isMouseDown && this . _hoverClicked && this . _contentWidget ?. isColorPickerVisible ) || InlineSuggestionHintsContentWidget . dropDownVisible ) {
245250 return ;
246251 }
247252 this . _hoverActivatedByColorDecoratorClick = false ;
@@ -257,10 +262,6 @@ export class ModesHoverController implements IEditorContribution {
257262 return this . _contentWidget ;
258263 }
259264
260- public isColorPickerVisible ( ) : boolean {
261- return this . _contentWidget ?. isColorPickerVisible ( ) || false ;
262- }
263-
264265 public showContentHover ( range : Range , mode : HoverStartMode , source : HoverStartSource , focus : boolean , activatedByColorDecoratorClick : boolean = false ) : void {
265266 this . _hoverActivatedByColorDecoratorClick = activatedByColorDecoratorClick ;
266267 this . _getOrCreateContentWidget ( ) . startShowingAtRange ( range , mode , source , focus ) ;
@@ -302,8 +303,12 @@ export class ModesHoverController implements IEditorContribution {
302303 this . _contentWidget ?. goToBottom ( ) ;
303304 }
304305
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 ;
307312 }
308313
309314 public dispose ( ) : void {
@@ -367,7 +372,7 @@ class ShowOrFocusHoverAction extends EditorAction {
367372 const range = new Range ( position . lineNumber , position . column , position . lineNumber , position . column ) ;
368373 const focus = editor . getOption ( EditorOption . accessibilitySupport ) === AccessibilitySupport . Enabled || ! ! args ?. focus ;
369374
370- if ( controller . isHoverVisible ( ) ) {
375+ if ( controller . isHoverVisible ) {
371376 controller . focus ( ) ;
372377 } else {
373378 controller . showContentHover ( range , HoverStartMode . Immediate , HoverStartSource . Keyboard , focus ) ;
0 commit comments