diff options
author | rebornix <penn.lv@gmail.com> | 2020-10-14 03:43:13 +0300 |
---|---|---|
committer | rebornix <penn.lv@gmail.com> | 2020-10-14 03:43:13 +0300 |
commit | 72e27c0b237190323f8b8db1f6c3e511ada9f17d (patch) | |
tree | 48a963c3a26cd3616fcfe08fca5c543a8ab9b484 | |
parent | de18f21e99a4e3bcb11e978c33c3af58ac1da745 (diff) |
add when clause for copy/paste command in notebook editor.
-rw-r--r-- | src/vs/workbench/contrib/notebook/browser/contrib/coreActions.ts | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/vs/workbench/contrib/notebook/browser/contrib/coreActions.ts b/src/vs/workbench/contrib/notebook/browser/contrib/coreActions.ts index f92245e2f3c..c3ccae4606b 100644 --- a/src/vs/workbench/contrib/notebook/browser/contrib/coreActions.ts +++ b/src/vs/workbench/contrib/notebook/browser/contrib/coreActions.ts @@ -992,6 +992,7 @@ registerAction2(class extends NotebookCellAction { keybinding: platform.isNative ? undefined : { primary: KeyMod.CtrlCmd | KeyCode.KEY_C, win: { primary: KeyMod.CtrlCmd | KeyCode.KEY_C, secondary: [KeyMod.CtrlCmd | KeyCode.Insert] }, + when: NOTEBOOK_EDITOR_FOCUSED, weight: KeybindingWeight.WorkbenchContrib } }); @@ -1019,6 +1020,7 @@ registerAction2(class extends NotebookCellAction { keybinding: platform.isNative ? undefined : { primary: KeyMod.CtrlCmd | KeyCode.KEY_X, win: { primary: KeyMod.CtrlCmd | KeyCode.KEY_X, secondary: [KeyMod.Shift | KeyCode.Delete] }, + when: ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, NOTEBOOK_EDITOR_EDITABLE, NOTEBOOK_CELL_EDITABLE), weight: KeybindingWeight.WorkbenchContrib } }); @@ -1054,6 +1056,7 @@ registerAction2(class extends NotebookAction { primary: KeyMod.CtrlCmd | KeyCode.KEY_V, win: { primary: KeyMod.CtrlCmd | KeyCode.KEY_V, secondary: [KeyMod.Shift | KeyCode.Insert] }, linux: { primary: KeyMod.CtrlCmd | KeyCode.KEY_V, secondary: [KeyMod.Shift | KeyCode.Insert] }, + when: ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, NOTEBOOK_EDITOR_EDITABLE), weight: KeybindingWeight.EditorContrib } }); |