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

Remove CodeRay's white default for comments

These are unreadable on many terminals.
e.g.  http://stackoverflow.com/questions/7798795/how-to-adjust-pry-colors
This commit is contained in:
Conrad Irwin 2011-10-18 22:49:11 -07:00
parent c544c1d699
commit c91975bb51

View file

@ -253,6 +253,26 @@ class Pry
self.line_buffer = [""]
self.eval_path = "(pry)"
self.active_sessions = 0
fix_coderay_colors
end
# To avoid mass-confusion, we change the default colour of "white" to
# "grey" enabling global legibility
def self.fix_coderay_colors
to_fix = if (CodeRay::Encoders::Terminal::TOKEN_COLORS rescue nil)
# CodeRay 1.0.0
CodeRay::Encoders::Terminal::TOKEN_COLORS
else
# CodeRay 0.9
begin
require 'coderay/encoders/term'
CodeRay::Encoders::Term::TOKEN_COLORS
rescue => e
end
end
to_fix[:comment] = "1;30" if to_fix
end
# Basic initialization.