Skip to content

Commit

Permalink
add a command to playpen (#1066)
Browse files Browse the repository at this point in the history
  • Loading branch information
rnitta authored and Dylan-DPC committed Oct 11, 2019
1 parent 2b3304c commit 01e5030
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/theme/book.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ function playpen_text(playpen) {
editor.addEventListener("change", function (e) {
update_play_button(playpen_block, playground_crates);
});
// add Ctrl-Enter command to execute rust code
editor.commands.addCommand({
name: "run",
bindKey: {
win: "Ctrl-Enter",
mac: "Ctrl-Enter"
},
exec: _editor => run_rust_code(playpen_block)
});
}
}
}
Expand Down

0 comments on commit 01e5030

Please sign in to comment.