Skip to content

Commit 402b28f

Browse files
authored
1 parent 0479e05 commit 402b28f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/vs/workbench/contrib/interactiveEditor/browser/interactiveEditorStrategies.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,13 @@ export class LiveStrategy extends EditModeStrategy {
226226
this._ctxShowingDiff = CTX_INTERACTIVE_EDITOR_SHOWING_DIFF.bindTo(contextKeyService);
227227
this._ctxShowingDiff.set(this._diffEnabled);
228228
this._inlineDiffDecorations.visible = this._diffEnabled;
229-
this._diffToggleListener = ModifierKeyEmitter.getInstance().event(e => {
230-
if (e.altKey || e.lastKeyReleased === 'alt') {
229+
const modKeys = ModifierKeyEmitter.getInstance();
230+
let lastIsAlt: boolean | undefined;
231+
this._diffToggleListener = modKeys.event(() => {
232+
const isAlt = modKeys.keyStatus.altKey && (!modKeys.keyStatus.ctrlKey && !modKeys.keyStatus.metaKey && !modKeys.keyStatus.shiftKey);
233+
if (lastIsAlt !== isAlt) {
231234
this.toggleDiff();
235+
lastIsAlt = isAlt;
232236
}
233237
});
234238
}

0 commit comments

Comments
 (0)