From d5ef373b1194bac64784ae316d125d7a2cf1988a Mon Sep 17 00:00:00 2001 From: tomoya ishida Date: Sun, 28 May 2023 18:20:13 +0900 Subject: [PATCH] [ruby/irb] Set maximum document dialog height by preferred_dialog_height provided by Reline (https://github.com/ruby/irb/pull/591) https://github.com/ruby/irb/commit/df6907aca9 --- lib/irb/input-method.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/irb/input-method.rb b/lib/irb/input-method.rb index 992968ffdc..4e049b22db 100644 --- a/lib/irb/input-method.rb +++ b/lib/irb/input-method.rb @@ -401,6 +401,7 @@ module IRB 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") + contents = contents.take(preferred_dialog_height) if respond_to?(:preferred_dialog_height) y = cursor_pos_to_render.y DialogRenderInfo.new(pos: Reline::CursorPos.new(x, y), contents: contents, width: width, bg_color: '49')