Skip to content

Commit

Permalink
fix #102504.
Browse files Browse the repository at this point in the history
  • Loading branch information
rebornix authored and joaomoreno committed Jul 21, 2020
1 parent a4d952f commit ca0d005
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/vs/workbench/contrib/notebook/browser/contrib/coreActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1319,11 +1319,9 @@ registerAction2(class extends NotebookAction {
});

async function splitCell(context: INotebookCellActionContext): Promise<void> {
if (context.cell.cellKind === CellKind.Code) {
const newCells = await context.notebookEditor.splitNotebookCell(context.cell);
if (newCells) {
context.notebookEditor.focusNotebookCell(newCells[newCells.length - 1], 'editor');
}
const newCells = await context.notebookEditor.splitNotebookCell(context.cell);
if (newCells) {
context.notebookEditor.focusNotebookCell(newCells[newCells.length - 1], 'editor');
}
}

Expand All @@ -1335,13 +1333,13 @@ registerAction2(class extends NotebookCellAction {
title: localize('notebookActions.splitCell', "Split Cell"),
menu: {
id: MenuId.NotebookCellTitle,
when: ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, NOTEBOOK_CELL_TYPE.isEqualTo('code'), NOTEBOOK_EDITOR_EDITABLE, NOTEBOOK_CELL_EDITABLE, InputFocusedContext),
when: ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, NOTEBOOK_EDITOR_EDITABLE, NOTEBOOK_CELL_EDITABLE, InputFocusedContext),
order: CellToolbarOrder.SplitCell,
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),
when: ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, NOTEBOOK_EDITOR_EDITABLE, NOTEBOOK_CELL_EDITABLE, InputFocusedContext),
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.US_BACKSLASH),
weight: KeybindingWeight.WorkbenchContrib
},
Expand Down

0 comments on commit ca0d005

Please sign in to comment.