Skip to content

Commit f17b1ec

Browse files
committed
more web friendly keybindings for New Window and New File commands
1 parent e14c37c commit f17b1ec

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/vs/workbench/browser/actions/windowActions.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { URI } from 'vs/base/common/uri';
2323
import { getIconClasses } from 'vs/editor/common/services/getIconClasses';
2424
import { FileKind } from 'vs/platform/files/common/files';
2525
import { splitName } from 'vs/base/common/labels';
26-
import { isMacintosh } from 'vs/base/common/platform';
26+
import { isMacintosh, isWeb } from 'vs/base/common/platform';
2727
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
2828
import { inQuickPickContext, getQuickNavigateHandler } from 'vs/workbench/browser/quickaccess';
2929
import { IHostService } from 'vs/workbench/services/host/browser/host';
@@ -368,7 +368,8 @@ class NewWindowAction extends Action2 {
368368
f1: true,
369369
keybinding: {
370370
weight: KeybindingWeight.WorkbenchContrib,
371-
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_N
371+
primary: isWeb ? (KeyMod.CtrlCmd | KeyMod.Alt | KeyMod.Shift | KeyCode.KEY_N) : KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_N,
372+
secondary: isWeb ? [KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_N] : undefined
372373
},
373374
menu: {
374375
id: MenuId.MenubarFileMenu,

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { RawContextKey, IContextKey, IContextKeyService, ContextKeyExpr } from '
2121
import { IFileService } from 'vs/platform/files/common/files';
2222
import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
2323
import { KeyMod, KeyCode, KeyChord } from 'vs/base/common/keyCodes';
24-
import { isWindows } from 'vs/base/common/platform';
24+
import { isWeb, isWindows } from 'vs/base/common/platform';
2525
import { ITextModelService } from 'vs/editor/common/services/resolverService';
2626
import { getResourceForCommand, getMultiSelectedResources, getOpenEditorsViewMultiSelection, IExplorerService } from 'vs/workbench/contrib/files/browser/files';
2727
import { IWorkspaceEditingService } from 'vs/workbench/services/workspaces/common/workspaceEditing';
@@ -663,7 +663,8 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
663663
KeybindingsRegistry.registerCommandAndKeybindingRule({
664664
weight: KeybindingWeight.WorkbenchContrib,
665665
when: null,
666-
primary: KeyMod.CtrlCmd | KeyCode.KEY_N,
666+
primary: isWeb ? (KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_N) : KeyMod.CtrlCmd | KeyCode.KEY_N,
667+
secondary: isWeb ? [KeyMod.CtrlCmd | KeyCode.KEY_N] : undefined,
667668
id: NEW_UNTITLED_FILE_COMMAND_ID,
668669
description: {
669670
description: NEW_UNTITLED_FILE_LABEL,

0 commit comments

Comments
 (0)