-
Notifications
You must be signed in to change notification settings - Fork 121
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
Conversation
@pocari I've been using this for a little while now and haven't run into any problems. |
Would it be desirable to support at least 4 color settings?
For example, this is a screenshot on my machine with your config. The highlighted row of the autocomplete is completely illegible. |
Like you said, I needed to be able to set up a foreground view.
You should be able to see something like the following |
Would love to see this feature! Is there any reason it hasn't been approved and merged yet? |
Probably a good idea to only set the Reline settings if they are set in IRB.conf and supported in reline. Like this: if IRB.conf[:DIALOG_DEFAULT_BG_COLOR] && Reline.respond_to?("dialog_default_bg_color=")
Reline.dialog_default_bg_color = IRB.conf[:DIALOG_DEFAULT_BG_COLOR]
end And similar for the other settings. Existing "~/.irbrc" files likely won't have those settings. |
@BrianHawley Thank you. I have fixed it. ( 12e5a7a ) |
By making ~/.irbrc look like the following, this PR may be unnecessary for us.
|
@@ -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=') |
There was a problem hiding this comment.
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=)
.
First of all, ruby/reline#413 has been merged! We're half way of fixing the issue 🎉 Ideally, changes like that will be released in a minor version bump, which will be if Gem::Version.new(Reline::VERSION) >= Gem::Version.new("0.4.0")
Reline.dialog_default_bg_color = IRB.conf[:DIALOG_DEFAULT_BG_COLOR]
Reline.dialog_pointer_bg_color = IRB.conf[:DIALOG_POINTER_BG_COLOR]
Reline.dialog_default_fg_color = IRB.conf[:DIALOG_DEFAULT_FG_COLOR]
Reline.dialog_pointer_fg_color = IRB.conf[:DIALOG_POINTER_FG_COLOR]
end And then assigning the defaults in Also, can you add some test cases for it? |
@pocari I've updated the
Thanks again for initiating these changes. Let me know if you want to do the extra work or you want someone else to take over it. |
Thank you for the pull request. |
I wanted to change the color of the completion dialog in Reline, so I made the following modifications to Reline
ruby/reline#413
Initially, I was thinking of setting the color in inputrc.
However, after receiving a report from Readline that warned that it was an unknown setting, I received a suggestion to set it in irbrc.
So, I made a modification to pass the configuration items to Reline using irbrc.
This is an example of using irbrc.
This is an example without irbrc settings.
You can try with the following settings