From b54f26b7048fc8dd103e7da5cf8f8dd73feb10d0 Mon Sep 17 00:00:00 2001 From: tompng Date: Tue, 2 Aug 2022 04:10:45 +0900 Subject: [ruby/irb] shortcut colorize_code to speedup pretty_print https://github.com/ruby/irb/commit/8a074a6904 --- lib/irb/color_printer.rb | 3 +++ 1 file changed, 3 insertions(+) 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 -- cgit v1.2.3