Skip to content

Commit

Permalink
Change Ctrl + Enter to render Markdown cells (#128)
Browse files Browse the repository at this point in the history
* Don't re-enter edit mode for markdown cells in `vim:run-cell-and-edit`

* Refactor (#5)
  • Loading branch information
firai authored Nov 25, 2023
1 parent ea557bb commit b7eb0e2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/labCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,15 @@ export function addNotebookCommands(
if (current) {
const { context, content } = current;
NotebookActions.run(content, context.sessionContext);
current.content.mode = 'edit';
// Don't re-enter edit mode for markdown cells
if (
content.activeCell !== null &&
content.activeCell.model.type === 'markdown'
) {
// no-op
} else {
current.content.mode = 'edit';
}
}
},
isEnabled
Expand Down

0 comments on commit b7eb0e2

Please sign in to comment.