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

[ruby/irb] shortcut colorize_code to speedup pretty_print

https://github.com/ruby/irb/commit/8a074a6904
This commit is contained in:
tompng 2022-08-02 04:10:45 +09:00 committed by git
parent 4406cb1bf1
commit b54f26b704

View file

@ -37,6 +37,9 @@ module IRB
width ||= str.length
case str
when ''
when ',', '=>', '[', ']', '{', '}', '..', '...', /\A@\w+\z/
super(str, width)
when /\A#</, '=', '>'
super(Color.colorize(str, [:GREEN]), width)
else