From 5efff040c62271af803e52b7cbbf88a598f81d00 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Mon, 2 Dec 2024 23:43:06 -0800 Subject: [PATCH] restore @completor attribute --- lib/iruby/backend.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/iruby/backend.rb b/lib/iruby/backend.rb index 84cd160..a8b17ef 100644 --- a/lib/iruby/backend.rb +++ b/lib/iruby/backend.rb @@ -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 @@ -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