diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-25 07:55:25 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-25 07:55:25 +0000 |
commit | 4f88c1f8487cefde7d3ec6fba1199c3030780010 (patch) | |
tree | 04dc61e522d16cc32b10ab3a0b5c8cb9555b9ca4 /lib/irb.rb | |
parent | 21166391d5685a2bda2861203cf28560e1a0353d (diff) | |
download | ruby-4f88c1f8487cefde7d3ec6fba1199c3030780010.tar.gz |
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
Diffstat (limited to 'lib/irb.rb')
-rw-r--r-- | lib/irb.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/irb.rb b/lib/irb.rb index ff793dcd64..d650e9c497 100644 --- a/lib/irb.rb +++ b/lib/irb.rb @@ -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 |