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:
parent
c544c1d699
commit
c91975bb51
1 changed files with 20 additions and 0 deletions
|
@ -253,6 +253,26 @@ class Pry
|
||||||
self.line_buffer = [""]
|
self.line_buffer = [""]
|
||||||
self.eval_path = "(pry)"
|
self.eval_path = "(pry)"
|
||||||
self.active_sessions = 0
|
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
|
end
|
||||||
|
|
||||||
# Basic initialization.
|
# Basic initialization.
|
||||||
|
|
Loading…
Reference in a new issue