add a command to playpen (#1066)
This commit is contained in:
parent
2b3304cb8b
commit
01e50303a2
|
@ -55,6 +55,15 @@ function playpen_text(playpen) {
|
||||||
editor.addEventListener("change", function (e) {
|
editor.addEventListener("change", function (e) {
|
||||||
update_play_button(playpen_block, playground_crates);
|
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)
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue