dont execute from outside the REPL

aamunger/replExecute2
amunger 2024-11-18 16:10:34 -08:00
parent 49c4b2caa0
commit 0aa6cb14ef
2 changed files with 12 additions and 2 deletions

View File

@ -453,11 +453,15 @@ registerAction2(class extends Action2 {
category: interactiveWindowCategory,
keybinding: [{
// when: NOTEBOOK_CELL_LIST_FOCUSED,
when: ContextKeyExpr.equals('activeEditor', 'workbench.editor.interactive'),
when: ContextKeyExpr.and(
IS_COMPOSITE_NOTEBOOK,
ContextKeyExpr.equals('activeEditor', 'workbench.editor.interactive')
),
primary: KeyMod.CtrlCmd | KeyCode.Enter,
weight: NOTEBOOK_EDITOR_WIDGET_ACTION_WEIGHT
}, {
when: ContextKeyExpr.and(
IS_COMPOSITE_NOTEBOOK,
ContextKeyExpr.equals('activeEditor', 'workbench.editor.interactive'),
ContextKeyExpr.equals('config.interactiveWindow.executeWithShiftEnter', true)
),
@ -465,6 +469,7 @@ registerAction2(class extends Action2 {
weight: NOTEBOOK_EDITOR_WIDGET_ACTION_WEIGHT
}, {
when: ContextKeyExpr.and(
IS_COMPOSITE_NOTEBOOK,
ContextKeyExpr.equals('activeEditor', 'workbench.editor.interactive'),
ContextKeyExpr.equals('config.interactiveWindow.executeWithShiftEnter', false)
),

View File

@ -338,11 +338,15 @@ registerAction2(class extends Action2 {
title: localize2('repl.execute', 'Execute REPL input'),
category: 'REPL',
keybinding: [{
when: ContextKeyExpr.equals('activeEditor', 'workbench.editor.repl'),
when: ContextKeyExpr.and(
IS_COMPOSITE_NOTEBOOK,
ContextKeyExpr.equals('activeEditor', 'workbench.editor.repl')
),
primary: KeyMod.CtrlCmd | KeyCode.Enter,
weight: NOTEBOOK_EDITOR_WIDGET_ACTION_WEIGHT
}, {
when: ContextKeyExpr.and(
IS_COMPOSITE_NOTEBOOK,
ContextKeyExpr.equals('activeEditor', 'workbench.editor.repl'),
ContextKeyExpr.equals('config.interactiveWindow.executeWithShiftEnter', true)
),
@ -350,6 +354,7 @@ registerAction2(class extends Action2 {
weight: NOTEBOOK_EDITOR_WIDGET_ACTION_WEIGHT
}, {
when: ContextKeyExpr.and(
IS_COMPOSITE_NOTEBOOK,
ContextKeyExpr.equals('activeEditor', 'workbench.editor.repl'),
ContextKeyExpr.equals('config.interactiveWindow.executeWithShiftEnter', false)
),