Skip to content

Commit

Permalink
Fix breakpoint context menu behaviour
Browse files Browse the repository at this point in the history
Signed-off-by: thegecko <[email protected]>
  • Loading branch information
thegecko committed Nov 1, 2019
1 parent 05f2e07 commit aa36ae6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class ElectronContextMenuRenderer implements ContextMenuRenderer {
// native context menu stops the event loop, so there is no keyboard events
this.context.resetAltPressed();
if (onHide) {
onHide();
menu.once('menu-will-close', () => onHide());
}
}

Expand Down
9 changes: 5 additions & 4 deletions packages/debug/src/browser/editor/debug-editor-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,11 @@ export class DebugEditorModel implements Disposable {
protected handleMouseDown(event: monaco.editor.IEditorMouseEvent): void {
if (event.target && event.target.type === monaco.editor.MouseTargetType.GUTTER_GLYPH_MARGIN) {
if (event.event.rightButton) {
this._position = event.target.position!;
this.contextMenu.render(DebugEditorModel.CONTEXT_MENU, event.event.browserEvent, () =>
setTimeout(() => this._position = undefined)
);
this.editor.focus();
setTimeout(() => {
this._position = event.target.position!;
this.contextMenu.render(DebugEditorModel.CONTEXT_MENU, event.event.browserEvent);
});
} else {
this.doToggleBreakpoint(event.target.position!);
}
Expand Down

0 comments on commit aa36ae6

Please sign in to comment.