aboutsummaryrefslogtreecommitdiffstats
path: root/lib/irb
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2020-02-10 23:22:24 +0900
committeraycabta <aycabta@gmail.com>2020-02-12 13:14:28 +0900
commit0719e1be11f4e3411b78f5e1d4de553f30f29bb0 (patch)
tree9732475411dc9b60b2ebacdb94722776387d6213 /lib/irb
parent3af3431c2c145134996e66f3d8d9ade8ad81bde0 (diff)
downloadruby-0719e1be11f4e3411b78f5e1d4de553f30f29bb0.tar.gz
[ruby/irb] Check doc namespace correctly
IRB::InputCompletor::PerfectMatchedProc crashes when doc not found because a variable name was incorrect. https://github.com/ruby/irb/commit/889fd4928f
Diffstat (limited to 'lib/irb')
-rw-r--r--lib/irb/completion.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/irb/completion.rb b/lib/irb/completion.rb
index 1897b4928f..8c0474dcc5 100644
--- a/lib/irb/completion.rb
+++ b/lib/irb/completion.rb
@@ -265,14 +265,14 @@ module IRB
end
end
- PerfectMatchedProc = ->(matched) {
+ PerfectMatchedProc = ->(matched, bind: IRB.conf[:MAIN_CONTEXT].workspace.binding) {
RDocRIDriver ||= RDoc::RI::Driver.new
if matched =~ /\A(?:::)?RubyVM/ and not ENV['RUBY_YES_I_AM_NOT_A_NORMAL_USER']
IRB.send(:easter_egg)
return
end
- namespace = retrieve_completion_data(matched, doc_namespace: true)
- return unless matched
+ namespace = retrieve_completion_data(matched, bind: bind, doc_namespace: true)
+ return unless namespace
if namespace.is_a?(Array)
out = RDoc::Markup::Document.new
namespace.each do |m|