Skip to content

Commit ea076f5

Browse files
committed
debt - tweak some keybindings
1 parent c29a6e1 commit ea076f5

File tree

3 files changed

+27
-6
lines changed

3 files changed

+27
-6
lines changed

src/vs/workbench/browser/parts/editor/editorActions.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import { Action2, IAction2Options, MenuId } from 'vs/platform/actions/common/act
3030
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
3131
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
3232
import { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes';
33-
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
33+
import { IKeybindingRule, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
3434
import { ILogService } from 'vs/platform/log/common/log';
3535
import { Categories } from 'vs/platform/action/common/actionCommonCategories';
3636
import { ActiveEditorAvailableEditorIdsContext, ActiveEditorContext, ActiveEditorGroupEmptyContext, AuxiliaryBarVisibleContext, EditorPartMaximizedEditorGroupContext, EditorPartMultipleEditorGroupsContext, IsAuxiliaryWindowFocusedContext, MultipleEditorGroupsContext, SideBarVisibleContext } from 'vs/workbench/common/contextkeys';
@@ -2493,13 +2493,15 @@ abstract class BaseMoveCopyEditorToNewWindowAction extends Action2 {
24932493
constructor(
24942494
id: string,
24952495
title: ICommandActionTitle,
2496+
keybinding: Omit<IKeybindingRule, 'id'> | undefined,
24962497
private readonly move: boolean
24972498
) {
24982499
super({
24992500
id,
25002501
title,
25012502
category: Categories.View,
25022503
precondition: ActiveEditorContext,
2504+
keybinding,
25032505
f1: true
25042506
});
25052507
}
@@ -2532,6 +2534,7 @@ export class MoveEditorToNewWindowAction extends BaseMoveCopyEditorToNewWindowAc
25322534
mnemonicTitle: localize({ key: 'miMoveEditorToNewWindow', comment: ['&& denotes a mnemonic'] }, "&&Move Editor into New Window"),
25332535
original: 'Move Editor into New Window'
25342536
},
2537+
undefined,
25352538
true
25362539
);
25372540
}
@@ -2547,6 +2550,7 @@ export class CopyEditorToNewindowAction extends BaseMoveCopyEditorToNewWindowAct
25472550
mnemonicTitle: localize({ key: 'miCopyEditorToNewWindow', comment: ['&& denotes a mnemonic'] }, "&&Copy Editor into New Window"),
25482551
original: 'Copy Editor into New Window'
25492552
},
2553+
{ primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyCode.KeyO), weight: KeybindingWeight.WorkbenchContrib },
25502554
false
25512555
);
25522556
}

src/vs/workbench/contrib/files/browser/fileActions.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,6 @@ export class OpenActiveFileInEmptyWorkspace extends Action2 {
661661
title: { value: OpenActiveFileInEmptyWorkspace.LABEL, original: 'Open Active File in New Empty Workspace' },
662662
f1: true,
663663
category: Categories.File,
664-
keybinding: { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyCode.KeyO), weight: KeybindingWeight.WorkbenchContrib },
665664
precondition: EmptyWorkspaceSupportContext
666665
});
667666
}

src/vs/workbench/electron-sandbox/actions/windowActions.ts

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { ThemeIcon } from 'vs/base/common/themables';
2323
import { isSingleFolderWorkspaceIdentifier, isWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace';
2424
import { Action2, IAction2Options, MenuId } from 'vs/platform/actions/common/actions';
2525
import { Categories } from 'vs/platform/action/common/actionCommonCategories';
26-
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
26+
import { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes';
2727
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
2828
import { isMacintosh } from 'vs/base/common/platform';
2929
import { getActiveWindow } from 'vs/base/browser/dom';
@@ -194,7 +194,12 @@ export class ZoomInActiveWindowAction extends BaseZoomAction {
194194
original: 'Zoom In (Active Window)'
195195
},
196196
category: Categories.View,
197-
f1: true
197+
f1: true,
198+
keybinding: {
199+
weight: KeybindingWeight.WorkbenchContrib,
200+
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.Equal),
201+
secondary: [KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Equal), KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.NumpadAdd)]
202+
}
198203
});
199204
}
200205

@@ -213,7 +218,16 @@ export class ZoomOutActiveWindowAction extends BaseZoomAction {
213218
original: 'Zoom Out (Active Window)'
214219
},
215220
category: Categories.View,
216-
f1: true
221+
f1: true,
222+
keybinding: {
223+
weight: KeybindingWeight.WorkbenchContrib,
224+
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.Minus),
225+
secondary: [KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Minus), KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.NumpadSubtract)],
226+
linux: {
227+
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.Minus),
228+
secondary: [KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.NumpadSubtract)]
229+
}
230+
}
217231
});
218232
}
219233

@@ -232,7 +246,11 @@ export class ZoomResetActiveWindowAction extends BaseZoomAction {
232246
original: 'Reset Zoom (Active Window)'
233247
},
234248
category: Categories.View,
235-
f1: true
249+
f1: true,
250+
keybinding: {
251+
weight: KeybindingWeight.WorkbenchContrib,
252+
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.Numpad0)
253+
}
236254
});
237255
}
238256

0 commit comments

Comments
 (0)