From 777f8ed9ef7cebae81230c32b3d56a910d3e9130 Mon Sep 17 00:00:00 2001 From: Stan Lo Date: Tue, 23 May 2023 13:44:04 +0900 Subject: [PATCH] WIP --- lib/irb.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/irb.rb b/lib/irb.rb index 26432a0fa..9ba73eb93 100644 --- a/lib/irb.rb +++ b/lib/irb.rb @@ -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