Skip to content

Commit cf92c7d

Browse files
Show breakpoint widget on Alt+click in gutter (#308687)
feat: show breakpoint widget on Alt+click in gutter Add Alt+click handling in the editor gutter to quickly add or edit conditional breakpoints. When Alt+clicking on a line without breakpoints, the breakpoint widget opens in conditional breakpoint mode. When Alt+clicking on a line with existing breakpoints, the breakpoint widget opens for editing the first breakpoint. Fixes #203259 Co-authored-by: Rob Lourens <roblourens@gmail.com>
1 parent 1028f06 commit cf92c7d

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,13 @@ export class BreakpointEditorContribution implements IBreakpointEditorContributi
281281

282282
if (breakpoints.length) {
283283
const isShiftPressed = e.event.shiftKey;
284+
const isAltPressed = e.event.altKey;
284285
const enabled = breakpoints.some(bp => bp.enabled);
285286

286-
if (isShiftPressed) {
287+
if (isAltPressed) {
288+
// Alt+click on existing breakpoint opens the breakpoint widget for editing
289+
this.showBreakpointWidget(breakpoints[0].lineNumber, breakpoints[0].column);
290+
} else if (isShiftPressed) {
287291
breakpoints.forEach(bp => this.debugService.enableOrDisableBreakpoints(!enabled, bp));
288292
} else if (!env.isLinux && breakpoints.some(bp => !!bp.condition || !!bp.logMessage || !!bp.hitCondition || !!bp.triggeredBy)) {
289293
// Show the dialog if there is a potential condition to be accidently lost.
@@ -327,7 +331,10 @@ export class BreakpointEditorContribution implements IBreakpointEditorContributi
327331
}
328332
}
329333
} else if (canSetBreakpoints) {
330-
if (e.event.middleButton) {
334+
if (e.event.altKey) {
335+
// Alt+click on empty gutter opens the breakpoint widget for adding a conditional breakpoint
336+
this.showBreakpointWidget(lineNumber, undefined, BreakpointWidgetContext.CONDITION);
337+
} else if (e.event.middleButton) {
331338
const action = this.configurationService.getValue<IDebugConfiguration>('debug').gutterMiddleClickAction;
332339
if (action !== 'none') {
333340
let context: BreakpointWidgetContext;

0 commit comments

Comments
 (0)