Skip to content

Commit 6030fca

Browse files
authored
Add default keybindings for notebook cell chat when it is enabled. (microsoft#208454)
1 parent a832f99 commit 6030fca

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import { Codicon } from 'vs/base/common/codicons';
7-
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
7+
import { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes';
88
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
99
import { localize, localize2 } from 'vs/nls';
1010
import { CONTEXT_ACCESSIBILITY_MODE_ENABLED } from 'vs/platform/accessibility/common/accessibility';
@@ -386,6 +386,18 @@ registerAction2(class extends NotebookAction {
386386
]
387387
},
388388
f1: false,
389+
keybinding: {
390+
when: ContextKeyExpr.and(
391+
NOTEBOOK_EDITOR_FOCUSED,
392+
NOTEBOOK_EDITOR_EDITABLE.isEqualTo(true),
393+
ContextKeyExpr.not(InputFocusedContextKey),
394+
CTX_INLINE_CHAT_HAS_PROVIDER,
395+
ContextKeyExpr.equals(`config.${NotebookSetting.cellChat}`, true)
396+
),
397+
weight: KeybindingWeight.WorkbenchContrib,
398+
primary: KeyMod.CtrlCmd | KeyCode.KeyI,
399+
secondary: [KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyCode.KeyI)],
400+
},
389401
menu: [
390402
{
391403
id: MenuId.NotebookCellBetween,

0 commit comments

Comments
 (0)