Skip to content

Commit 01e5030

Browse files
rnittaDylan-DPC
authored andcommitted
add a command to playpen (#1066)
1 parent 2b3304c commit 01e5030

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/theme/book.js

+9
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,15 @@ function playpen_text(playpen) {
5555
editor.addEventListener("change", function (e) {
5656
update_play_button(playpen_block, playground_crates);
5757
});
58+
// add Ctrl-Enter command to execute rust code
59+
editor.commands.addCommand({
60+
name: "run",
61+
bindKey: {
62+
win: "Ctrl-Enter",
63+
mac: "Ctrl-Enter"
64+
},
65+
exec: _editor => run_rust_code(playpen_block)
66+
});
5867
}
5968
}
6069
}

0 commit comments

Comments
 (0)