diff options
author | Adam Daniels <[email protected]> | 2023-05-18 21:33:28 -0400 |
---|---|---|
committer | git <[email protected]> | 2023-05-19 01:33:32 +0000 |
commit | b54b388f2a03a2ce553f8c02648f113403deb245 (patch) | |
tree | 12bd3a0404874deff1b16423db36a4b8ac3ca681 /lib/irb/input-method.rb | |
parent | 74600917a8eeff90ba28b857030052c5a4687155 (diff) |
[ruby/irb] Display mod key as `Option` on Darwin platforms
(https://github.com/ruby/irb/pull/584)
Check RUBY_PLATFORM for `darwin` and modify the mod key from `Alt` to
`Option`.
Diffstat (limited to 'lib/irb/input-method.rb')
-rw-r--r-- | lib/irb/input-method.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/irb/input-method.rb b/lib/irb/input-method.rb index ed5c53c385..992968ffdc 100644 --- a/lib/irb/input-method.rb +++ b/lib/irb/input-method.rb @@ -398,7 +398,8 @@ module IRB 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 |