diff options
author | tompng <tomoyapenguin@gmail.com> | 2022-08-02 04:10:45 +0900 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2022-08-04 08:37:03 +0900 |
commit | b54f26b7048fc8dd103e7da5cf8f8dd73feb10d0 (patch) | |
tree | 4b671f6dc20efbb097a52bfb5090dd8ff53f4e8b | |
parent | 4406cb1bf10e34757d9877b3b12d4b0c294c22fb (diff) | |
download | ruby-b54f26b7048fc8dd103e7da5cf8f8dd73feb10d0.tar.gz |
[ruby/irb] shortcut colorize_code to speedup pretty_print
https://github.com/ruby/irb/commit/8a074a6904
-rw-r--r-- | lib/irb/color_printer.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/irb/color_printer.rb b/lib/irb/color_printer.rb index 78f0b51520..1127bcecb4 100644 --- a/lib/irb/color_printer.rb +++ b/lib/irb/color_printer.rb @@ -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 |