aboutsummaryrefslogtreecommitdiffstats
path: root/lib/irb/input-method.rb
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2019-05-24 21:21:22 -0700
committerTakashi Kokubun <takashikkbn@gmail.com>2019-05-24 23:54:52 -0700
commitb83119be9e9a8611063142541993e4823a025622 (patch)
tree8bb0e47325d65d75876c1ee7aad35666dc9d3f4e /lib/irb/input-method.rb
parent3c6e1a8cf911d312edeb9dfcc9153be68867ca4f (diff)
downloadruby-b83119be9e9a8611063142541993e4823a025622.tar.gz
Incremental syntax highlight for IRB source lines
Closes: https://github.com/ruby/ruby/pull/2202
Diffstat (limited to 'lib/irb/input-method.rb')
-rw-r--r--lib/irb/input-method.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/irb/input-method.rb b/lib/irb/input-method.rb
index 412edcce24..bc144dca9c 100644
--- a/lib/irb/input-method.rb
+++ b/lib/irb/input-method.rb
@@ -222,6 +222,10 @@ module IRB
end
Reline.completion_append_character = nil
Reline.completion_proc = IRB::InputCompletor::CompletionProc
+ Reline.output_modifier_proc = proc do |output|
+ next unless IRB::Color.colorable?
+ IRB::Color.colorize_code(output)
+ end
Reline.dig_perfect_match_proc = IRB::InputCompletor::PerfectMatchedProc
end