aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-05-29 21:59:34 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-05-29 21:59:34 +0900
commit12644e8b0208b01f4f4cea550d161a86e6f25aa8 (patch)
treee82cafb8071b31b8b56fba38143991e36c9127e5
parent1da5c73932b2dcf2a089f125df1fe7cc4ab9fafd (diff)
downloadruby-12644e8b0208b01f4f4cea550d161a86e6f25aa8.tar.gz
Get rid of nested string interpolations
* lib/irb/color.rb (IRB::Color.colorize): get rid of nesting string interpolations not to confuse ruby-mode.el
-rw-r--r--lib/irb/color.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/irb/color.rb b/lib/irb/color.rb
index 71557ffbb9..caa7f5032a 100644
--- a/lib/irb/color.rb
+++ b/lib/irb/color.rb
@@ -94,7 +94,8 @@ module IRB # :nodoc:
def colorize(text, seq)
return text unless colorable?
- "#{seq.map { |s| "\e[#{const_get(s)}m" }.join('')}#{text}#{clear}"
+ seq = seq.map { |s| "\e[#{const_get(s)}m" }.join('')
+ "#{seq}#{text}#{clear}"
end
def scan(code)