summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAdam Daniels <adam@mediadrive.ca>2023-05-18 21:33:28 -0400
committergit <svn-admin@ruby-lang.org>2023-05-19 01:33:32 +0000
commitb54b388f2a03a2ce553f8c02648f113403deb245 (patch)
tree12bd3a0404874deff1b16423db36a4b8ac3ca681 /lib
parent74600917a8eeff90ba28b857030052c5a4687155 (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')
-rw-r--r--lib/irb/input-method.rb3
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