Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed to add parameters in irbrc to pass to Reline. #337

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions lib/irb/input-method.rb
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,18 @@ def initialize
if IRB.conf[:USE_AUTOCOMPLETE]
Reline.add_dialog_proc(:show_doc, SHOW_DOC_DIALOG, Reline::DEFAULT_DIALOG_CONTEXT)
end
if IRB.conf[:DIALOG_DEFAULT_BG_COLOR] && Reline.respond_to?('dialog_default_bg_color=')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's more idiomatic to use symbols rather than strings for respond_to?. E.g. Reline.respond_to?(:dialog_default_bg_color=).

Reline.dialog_default_bg_color = IRB.conf[:DIALOG_DEFAULT_BG_COLOR]
end
if IRB.conf[:DIALOG_POINTER_BG_COLOR] && Reline.respond_to?('dialog_pointer_bg_color=')
Reline.dialog_pointer_bg_color = IRB.conf[:DIALOG_POINTER_BG_COLOR]
end
if IRB.conf[:DIALOG_DEFAULT_FG_COLOR] && Reline.respond_to?('dialog_default_fg_color=')
Reline.dialog_default_fg_color = IRB.conf[:DIALOG_DEFAULT_FG_COLOR]
end
if IRB.conf[:DIALOG_POINTER_FG_COLOR] && Reline.respond_to?('dialog_pointer_fg_color=')
Reline.dialog_pointer_fg_color = IRB.conf[:DIALOG_POINTER_FG_COLOR]
end
end

def check_termination(&block)
Expand Down