fix: hide debug hover widget when esc pressed (#4487)

This commit is contained in:
Dan 2025-03-19 14:13:10 +08:00 committed by GitHub
parent 2a13cf55b5
commit 32faed75df
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 1 deletions

View File

@ -138,7 +138,13 @@ export class DebugModel implements IDebugModel {
this.toDispose.pushAll([
this.breakpointWidget,
this.editor.onKeyDown(() => this.debugHoverWidget.hide({ immediate: false })),
this.editor.onKeyDown((e) => {
if (e.code === 'Escape' && !e.altKey && !e.shiftKey && !e.metaKey) {
this.debugHoverWidget.hide({ immediate: true });
} else {
this.debugHoverWidget.hide({ immediate: false });
}
}),
this.editor.onDidChangeModelContent(() => this.renderFrames()),
this.debugSessionManager.onDidChange(() => this.renderFrames()),
this.debugBreakpointsService.onDidFocusedBreakpoints(({ range }) => {