ruby-changes:49354
From: nobu <ko1@a...>
Date: Mon, 25 Dec 2017 16:55:31 +0900 (JST)
Subject: [ruby-changes:49354] nobu:r61469 (trunk): irb.rb: fix highlight
nobu 2017-12-25 16:55:25 +0900 (Mon, 25 Dec 2017) New Revision: 61469 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61469 Log: irb.rb: fix highlight * lib/irb.rb (IRB::Irb#eval_input): fix highlight for multiple lines exception messages. Modified files: trunk/lib/irb.rb Index: lib/irb.rb =================================================================== --- lib/irb.rb (revision 61468) +++ lib/irb.rb (revision 61469) @@ -527,7 +527,9 @@ module IRB https://github.com/ruby/ruby/blob/trunk/lib/irb.rb#L527 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/