From b54b388f2a03a2ce553f8c02648f113403deb245 Mon Sep 17 00:00:00 2001 From: Adam Daniels Date: Thu, 18 May 2023 21:33:28 -0400 Subject: [PATCH] [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`. --- lib/irb/input-method.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/irb/input-method.rb b/lib/irb/input-method.rb index ed5c53c38555b4..992968ffdc7d1e 100644 --- a/lib/irb/input-method.rb +++ b/lib/irb/input-method.rb @@ -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