Skip to content

Commit 8a074a6

Browse files
tompnghsbt
authored andcommitted
shortcut colorize_code to speedup pretty_print
1 parent 4b38229 commit 8a074a6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/irb/color_printer.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ def text(str, width = nil)
3737
width ||= str.length
3838

3939
case str
40+
when ''
41+
when ',', '=>', '[', ']', '{', '}', '..', '...', /\A@\w+\z/
42+
super(str, width)
4043
when /\A#</, '=', '>'
4144
super(Color.colorize(str, [:GREEN]), width)
4245
else

0 commit comments

Comments
 (0)