1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
Nobuyoshi Nakada 2019-05-29 21:59:34 +09:00
parent 1da5c73932
commit 12644e8b02
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

View file

@ -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)