Skip to content

Commit

Permalink
[ruby/irb] Display mod key as Option on Darwin platforms
Browse files Browse the repository at this point in the history
(ruby/irb#584)

Check RUBY_PLATFORM for `darwin` and modify the mod key from `Alt` to
`Option`.
  • Loading branch information
adam12 authored and matzbot committed May 19, 2023
1 parent 7460091 commit b54b388
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/irb/input-method.rb
Expand Up @@ -398,7 +398,8 @@ def auto_indent(&block)
formatter = RDoc::Markup::ToAnsi.new
formatter.width = width
dialog.trap_key = alt_d
message = 'Press Alt+d to read the full document'
mod_key = RUBY_PLATFORM.match?(/darwin/) ? "Option" : "Alt"
message = "Press #{mod_key}+d to read the full document"
contents = [message] + doc.accept(formatter).split("\n")

y = cursor_pos_to_render.y
Expand Down

0 comments on commit b54b388

Please sign in to comment.