Skip to content

Commit ed5cf37

Browse files
committed
Rewrite an expression to detect multiline
1 parent 9eb1801 commit ed5cf37

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/irb.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ def prompt(prompt, ltype, indent, line_no) # :nodoc:
737737

738738
def output_value # :nodoc:
739739
str = @context.inspect_last_value
740-
multiline_p = str.each_line.take(2).length > 1
740+
multiline_p = /\A.*\Z/ !~ str
741741
if multiline_p && @context.newline_before_multiline_output?
742742
printf @context.return_format, "\n#{str}"
743743
else

0 commit comments

Comments
 (0)