ruby-changes:59758
From: Kenta <ko1@a...>
Date: Tue, 21 Jan 2020 09:53:49 +0900 (JST)
Subject: [ruby-changes:59758] 93ca212dda (master): [ruby/irb] [ruby/irb] Rewrite an expression to detect multiline
https://git.ruby-lang.org/ruby.git/commit/?id=93ca212dda From 93ca212ddac5ac49134f2058c24db3948b6695c6 Mon Sep 17 00:00:00 2001 From: Kenta Murata <mrkn@m...> Date: Mon, 20 Jan 2020 09:38:52 +0900 Subject: [ruby/irb] [ruby/irb] Rewrite an expression to detect multiline https://github.com/ruby/irb/commit/ed5cf375a6 https://github.com/ruby/irb/commit/5b7bbf9c34 diff --git a/lib/irb.rb b/lib/irb.rb index 3e08877..ac868d9 100644 --- a/lib/irb.rb +++ b/lib/irb.rb @@ -737,7 +737,7 @@ module IRB https://github.com/ruby/ruby/blob/trunk/lib/irb.rb#L737 def output_value # :nodoc: str = @context.inspect_last_value - multiline_p = str.each_line.take(2).length > 1 + multiline_p = /\A.*\Z/ !~ str if multiline_p && @context.newline_before_multiline_output? printf @context.return_format, "\n#{str}" else -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/