1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

irb.rb: fix highlight

* lib/irb.rb (IRB::Irb#eval_input): fix highlight for multiple
  lines exception messages.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2017-12-25 07:55:25 +00:00
parent efee0c87c1
commit 72ac5986bd

View file

@ -527,7 +527,9 @@ module IRB
printf "... %d levels...\n", levels if levels > 0
end
puts messages.reverse
print "#{attr[1]}#{exc.class} (#{attr[4]}#{exc}#{attr[0, 1]})#{attr[]}\n"
messages = exc.to_s.split(/\n/)
print "#{attr[1]}#{exc.class} (#{attr[4]}#{messages.shift}#{attr[0, 1]})#{attr[]}\n"
puts messages.map {|s| "#{attr[1]}#{s}#{attr[]}\n"}
print "Maybe IRB bug!\n" if irb_bug
end
end