提交 404eb11b 编写于 作者: R rebornix

re #101436. update builtin notebook actions keybindings

上级 71a147f9
......@@ -1110,6 +1110,11 @@ registerAction2(class extends NotebookAction {
order: CellToolbarOrder.ClearCellOutput,
group: CELL_TITLE_GROUP_ID
},
keybinding: {
when: ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, ContextKeyExpr.not(InputFocusedContextKey), NOTEBOOK_CELL_HAS_OUTPUTS),
primary: KeyMod.Alt | KeyCode.Delete,
weight: KeybindingWeight.WorkbenchContrib
},
icon: { id: 'codicon/clear-all' },
});
}
......@@ -1271,6 +1276,11 @@ registerAction2(class extends NotebookAction {
group: CELL_TITLE_GROUP_ID
},
icon: { id: 'codicon/split-vertical' },
keybinding: {
when: ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, NOTEBOOK_CELL_TYPE.isEqualTo('code'), NOTEBOOK_EDITOR_EDITABLE, NOTEBOOK_CELL_EDITABLE, InputFocusedContext),
primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.US_BACKSLASH,
weight: KeybindingWeight.WorkbenchContrib
},
});
}
......@@ -1293,6 +1303,11 @@ registerAction2(class extends NotebookAction {
{
id: JOIN_CELL_ABOVE_COMMAND_ID,
title: localize('notebookActions.joinCellAbove', "Join with Previous Cell"),
keybinding: {
when: NOTEBOOK_EDITOR_FOCUSED,
primary: KeyMod.WinCtrl | KeyMod.Alt | KeyMod.Shift | KeyCode.KEY_J,
weight: KeybindingWeight.WorkbenchContrib
}
});
}
......@@ -1307,6 +1322,11 @@ registerAction2(class extends NotebookAction {
{
id: JOIN_CELL_BELOW_COMMAND_ID,
title: localize('notebookActions.joinCellBelow', "Join with Next Cell"),
keybinding: {
when: NOTEBOOK_EDITOR_FOCUSED,
primary: KeyMod.WinCtrl | KeyMod.Alt | KeyCode.KEY_J,
weight: KeybindingWeight.WorkbenchContrib
}
});
}
......
......@@ -12,7 +12,7 @@ import { registerNotebookContribution } from 'vs/workbench/contrib/notebook/brow
import { registerAction2, Action2 } from 'vs/platform/actions/common/actions';
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
import { InputFocusedContextKey } from 'vs/platform/contextkey/common/contextkeys';
import { KeyCode } from 'vs/base/common/keyCodes';
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
......@@ -138,7 +138,11 @@ registerAction2(class extends Action2 {
category: NOTEBOOK_ACTIONS_CATEGORY,
keybinding: {
when: ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, ContextKeyExpr.not(InputFocusedContextKey)),
primary: KeyCode.LeftArrow,
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.US_OPEN_SQUARE_BRACKET,
mac: {
primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.US_OPEN_SQUARE_BRACKET
},
secondary: [KeyCode.LeftArrow],
weight: KeybindingWeight.WorkbenchContrib
},
precondition: NOTEBOOK_IS_ACTIVE_EDITOR,
......@@ -177,7 +181,11 @@ registerAction2(class extends Action2 {
category: NOTEBOOK_ACTIONS_CATEGORY,
keybinding: {
when: ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, ContextKeyExpr.not(InputFocusedContextKey)),
primary: KeyCode.RightArrow,
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.US_CLOSE_SQUARE_BRACKET,
mac: {
primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.US_CLOSE_SQUARE_BRACKET
},
secondary: [KeyCode.RightArrow],
weight: KeybindingWeight.WorkbenchContrib
},
precondition: NOTEBOOK_IS_ACTIVE_EDITOR,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册