Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
st0012 committed May 23, 2023
1 parent b5f3efd commit 777f8ed
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/irb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,17 @@ def output_value(omit = false) # :nodoc:
end
end
end

screen_height, screen_width = Reline::IOGate.get_screen_size
# exclude the input line from calculation
output_exceeds_screen = (screen_height - 1) * screen_width < Reline::Unicode.calculate_width(str, true)

if output_exceeds_screen
RDoc::RI::Driver.new.page do |io|
io.write(str)
end
end

if multiline_p && @context.newline_before_multiline_output?
printf @context.return_format, "\n#{str}"
else
Expand Down

0 comments on commit 777f8ed

Please sign in to comment.