Skip to content

Commit df6907a

Browse files
authored
Set maximum document dialog height by preferred_dialog_height provided by Reline (#591)
1 parent fd49135 commit df6907a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/irb/input-method.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ def auto_indent(&block)
401401
mod_key = RUBY_PLATFORM.match?(/darwin/) ? "Option" : "Alt"
402402
message = "Press #{mod_key}+d to read the full document"
403403
contents = [message] + doc.accept(formatter).split("\n")
404+
contents = contents.take(preferred_dialog_height) if respond_to?(:preferred_dialog_height)
404405

405406
y = cursor_pos_to_render.y
406407
DialogRenderInfo.new(pos: Reline::CursorPos.new(x, y), contents: contents, width: width, bg_color: '49')

0 commit comments

Comments
 (0)