Skip to content

Commit

Permalink
shortcut colorize_code to speedup pretty_print
Browse files Browse the repository at this point in the history
  • Loading branch information
tompng authored and hsbt committed Aug 3, 2022
1 parent 4b38229 commit 8a074a6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/irb/color_printer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ def text(str, width = nil)
width ||= str.length

case str
when ''
when ',', '=>', '[', ']', '{', '}', '..', '...', /\A@\w+\z/
super(str, width)
when /\A#</, '=', '>'
super(Color.colorize(str, [:GREEN]), width)
else
Expand Down

0 comments on commit 8a074a6

Please sign in to comment.