Skip to content

Commit e07b7eb

Browse files
committed
restore completor attribute
1 parent b569454 commit e07b7eb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: lib/iruby/backend.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ def initialize
5050
@irb = IRB::Irb.new(@workspace)
5151
@eval_path = @irb.context.irb_path
5252
IRB.conf[:MAIN_CONTEXT] = @irb.context
53+
@completor = IRB::RegexpCompletor.new if defined? IRB::RegexpCompletor # IRB::VERSION >= 1.8.2
5354
end
5455

5556
def eval_binding
@@ -66,10 +67,9 @@ def eval(code, store_history)
6667
end
6768

6869
def complete(code)
69-
if defined? IRB::RegexpCompletor # IRB::VERSION >= 1.8.2
70-
completor = IRB::RegexpCompletor.new
70+
if @completor
7171
# preposing and postposing never used, so they are empty, pass only target as code
72-
completor.completion_candidates('', code, '', bind: @workspace.binding)
72+
@completor.completion_candidates('', code, '', bind: @workspace.binding)
7373
else
7474
IRB::InputCompletor::CompletionProc.call(code)
7575
end

0 commit comments

Comments
 (0)