Skip to content

Commit

Permalink
restore completor attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
sealocal committed Dec 3, 2024
1 parent b569454 commit e07b7eb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/iruby/backend.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def initialize
@irb = IRB::Irb.new(@workspace)
@eval_path = @irb.context.irb_path
IRB.conf[:MAIN_CONTEXT] = @irb.context
@completor = IRB::RegexpCompletor.new if defined? IRB::RegexpCompletor # IRB::VERSION >= 1.8.2
end

def eval_binding
Expand All @@ -66,10 +67,9 @@ def eval(code, store_history)
end

def complete(code)
if defined? IRB::RegexpCompletor # IRB::VERSION >= 1.8.2
completor = IRB::RegexpCompletor.new
if @completor
# preposing and postposing never used, so they are empty, pass only target as code
completor.completion_candidates('', code, '', bind: @workspace.binding)
@completor.completion_candidates('', code, '', bind: @workspace.binding)
else
IRB::InputCompletor::CompletionProc.call(code)
end
Expand Down

0 comments on commit e07b7eb

Please sign in to comment.