Johannes Rieken 2023-06-01 16:11:24 +02:00 committed by GitHub
parent 0479e057c1
commit 402b28f04a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}
});
}