Skip to content

Commit

Permalink
Merge pull request ruby#183 from liberaldev/add-shortcut
Browse files Browse the repository at this point in the history
Add run shortcut
  • Loading branch information
hmdne authored Sep 21, 2024
2 parents 6cf3fa0 + c106e33 commit 11830f3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/try_ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ def initialize
# Bind run button
$document.on(:click, '#btn_run') { do_run }

#If hold down the control and the Enter key goes down, run
$document.on :keydown, '#editor' do |e|
if e.key == "Enter" && e.ctrl?
do_run
end
end

# Is this the playground? If so, run code specific to the playground without
# setting up the tutorial buttons.
if title_element.inner_text.match(/playground/i)
Expand Down

0 comments on commit 11830f3

Please sign in to comment.