Skip to content

Commit 6b5dab6

Browse files
committed
jupyter: fix command+enter sending newline
- how was this still broken? anyway, finally fixed!
1 parent 6ca921b commit 6b5dab6

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/packages/frontend/jupyter/codemirror-editor.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,11 @@ export const CodeMirrorEditor: React.FC<CodeMirrorEditorProps> = ({
623623
options0.extraKeys["PageDown"] = page_down_key;
624624
options0.extraKeys["Cmd-/"] = "toggleComment";
625625
options0.extraKeys["Ctrl-/"] = "toggleComment";
626-
options0.extraKeys["Ctrl-Enter"] = () => {}; // ignore control+enter, since there's a shortcut
626+
// ignore shift+enter, control+enter, alt+enter and meta+enter since there's a shortcut
627+
options0.extraKeys["Shift-Enter"] = () => {};
628+
options0.extraKeys["Ctrl-Enter"] = () => {};
629+
options0.extraKeys["Alt-Enter"] = () => {};
630+
options0.extraKeys["Cmd-Enter"] = () => {};
627631
/*
628632
Disabled for now since fold state isn't preserved.
629633
if (options0.foldGutter) {

src/packages/frontend/jupyter/commands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ export function commands(actions: AllActions): {
764764
// on a mac). https://github.com/sagemathinc/cocalc/issues/7000
765765
"run cell": {
766766
i: "play",
767-
m: "Run Selected Cells and Do not Advance",
767+
m: "Run Selected Cells and Do Not Advance",
768768
b: "Stay",
769769
t: "Run all cells that are currently selected. Do not move the selection.",
770770
k: [

0 commit comments

Comments
 (0)