Skip to content

Commit

Permalink
Set maximum document dialog height by preferred_dialog_height provide…
Browse files Browse the repository at this point in the history
…d by Reline (#591)
  • Loading branch information
tompng authored May 28, 2023
1 parent fd49135 commit df6907a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/irb/input-method.rb
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ def auto_indent(&block)
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')
Expand Down

0 comments on commit df6907a

Please sign in to comment.