Skip to content

Commit 4155507

Browse files
committed
Allow Cmd-Enter as run-code shortcut in sandbox
1 parent 613d736 commit 4155507

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

html/js/code.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ addEventListener("load", () => {
22
let editor = CodeMirror.fromTextArea(document.querySelector("#editor"), {
33
mode: "javascript",
44
extraKeys: {
5-
"Ctrl-Enter": runCode
5+
"Ctrl-Enter": runCode,
6+
"Cmd-Enter": runCode
67
},
78
matchBrackets: true,
89
lineNumbers: true

html/js/ejs.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ window.addEventListener("load", () => {
6767
let keyMap = {
6868
Esc(cm) { cm.display.input.blur() },
6969
"Ctrl-Enter"(cm) { runCode(cm.state.context) },
70+
"Cmd-Enter"(cm) { runCode(cm.state.context) },
7071
"Ctrl-`"(cm) { closeCode(cm.state.context) },
7172
"Ctrl-Q": resetSandbox
7273
}

0 commit comments

Comments
 (0)