mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
This commit is contained in:
parent
0479e057c1
commit
402b28f04a
|
@ -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;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue