Skip to content

Commit 11830f3

Browse files
authored
Merge pull request #183 from liberaldev/add-shortcut
Add run shortcut
2 parents 6cf3fa0 + c106e33 commit 11830f3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

app/try_ruby.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@ def initialize
5959
# Bind run button
6060
$document.on(:click, '#btn_run') { do_run }
6161

62+
#If hold down the control and the Enter key goes down, run
63+
$document.on :keydown, '#editor' do |e|
64+
if e.key == "Enter" && e.ctrl?
65+
do_run
66+
end
67+
end
68+
6269
# Is this the playground? If so, run code specific to the playground without
6370
# setting up the tutorial buttons.
6471
if title_element.inner_text.match(/playground/i)

0 commit comments

Comments
 (0)