Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken committed Jun 1, 2023
1 parent 0479e05 commit 402b28f
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,13 @@ export class LiveStrategy extends EditModeStrategy {
this._ctxShowingDiff = CTX_INTERACTIVE_EDITOR_SHOWING_DIFF.bindTo(contextKeyService);
this._ctxShowingDiff.set(this._diffEnabled);
this._inlineDiffDecorations.visible = this._diffEnabled;
this._diffToggleListener = ModifierKeyEmitter.getInstance().event(e => {
if (e.altKey || e.lastKeyReleased === 'alt') {
const modKeys = ModifierKeyEmitter.getInstance();
let lastIsAlt: boolean | undefined;
this._diffToggleListener = modKeys.event(() => {
const isAlt = modKeys.keyStatus.altKey && (!modKeys.keyStatus.ctrlKey && !modKeys.keyStatus.metaKey && !modKeys.keyStatus.shiftKey);
if (lastIsAlt !== isAlt) {
this.toggleDiff();
lastIsAlt = isAlt;
}
});
}
Expand Down

0 comments on commit 402b28f

Please sign in to comment.