fixing escape does not work

pull/236202/head
Aiday Marlen Kyzy 2024-12-16 10:49:49 +01:00
parent ce50bd4876
commit fc1743b47c
No known key found for this signature in database
GPG Key ID: 24A8B53DBD26FF4E
1 changed files with 13 additions and 10 deletions

View File

@ -83,18 +83,17 @@ export class ContentHoverController extends Disposable implements IEditorContrib
sticky: hoverOpts.sticky,
hidingDelay: hoverOpts.hidingDelay
};
if (hoverOpts.enabled) {
this._listenersStore.add(this._editor.onMouseDown((e: IEditorMouseEvent) => this._onEditorMouseDown(e)));
this._listenersStore.add(this._editor.onMouseUp(() => this._onEditorMouseUp()));
this._listenersStore.add(this._editor.onMouseMove((e: IEditorMouseEvent) => this._onEditorMouseMove(e)));
this._listenersStore.add(this._editor.onKeyDown((e: IKeyboardEvent) => this._onKeyDown(e)));
this._listenersStore.add(this._editor.onMouseLeave((e) => this._onEditorMouseLeave(e)));
this._listenersStore.add(this._editor.onDidChangeModel(() => this._cancelSchedulerAndHide()));
this._listenersStore.add(this._editor.onDidChangeModelContent(() => this._cancelScheduler()));
this._listenersStore.add(this._editor.onDidScrollChange((e: IScrollEvent) => this._onEditorScrollChanged(e)));
} else {
if (!hoverOpts.enabled) {
this._cancelSchedulerAndHide();
}
this._listenersStore.add(this._editor.onMouseDown((e: IEditorMouseEvent) => this._onEditorMouseDown(e)));
this._listenersStore.add(this._editor.onMouseUp(() => this._onEditorMouseUp()));
this._listenersStore.add(this._editor.onMouseMove((e: IEditorMouseEvent) => this._onEditorMouseMove(e)));
this._listenersStore.add(this._editor.onKeyDown((e: IKeyboardEvent) => this._onKeyDown(e)));
this._listenersStore.add(this._editor.onMouseLeave((e) => this._onEditorMouseLeave(e)));
this._listenersStore.add(this._editor.onDidChangeModel(() => this._cancelSchedulerAndHide()));
this._listenersStore.add(this._editor.onDidChangeModelContent(() => this._cancelScheduler()));
this._listenersStore.add(this._editor.onDidScrollChange((e: IScrollEvent) => this._onEditorScrollChanged(e)));
}
private _unhookListeners(): void {
@ -203,6 +202,10 @@ export class ContentHoverController extends Disposable implements IEditorContrib
if (this._contentWidget && (this._contentWidget.isFocused || this._contentWidget.isResizing || this._isMouseDown && this._contentWidget.isColorPickerVisible)) {
return false;
}
const hiddenAndDisabled = !this._contentWidget?.isVisible && !this._hoverSettings.enabled;
if (hiddenAndDisabled) {
return false;
}
const sticky = this._hoverSettings.sticky;
if (sticky && this._contentWidget?.isVisibleFromKeyboard) {
// Sticky mode is on and the hover has been shown via keyboard