mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
Don't continually restart bond
This commit is contained in:
parent
9852c90905
commit
b1028e2935
1 changed files with 10 additions and 8 deletions
|
@ -5,16 +5,18 @@ class Pry
|
|||
module BondCompleter
|
||||
|
||||
def self.build_completion_proc(target, pry=nil, commands=[""])
|
||||
Bond.restart(:eval_binding => lambda{ pry.current_context })
|
||||
Bond.complete(:on => /\A/) do |input|
|
||||
Pry.commands.complete(input.line,
|
||||
:pry_instance => pry,
|
||||
:target => pry.current_context,
|
||||
:command_set => pry.commands)
|
||||
end
|
||||
|
||||
Pry.th[:pry] = pry
|
||||
proc{ |*a| Bond.agent.call(*a) }
|
||||
end
|
||||
|
||||
Bond.start(:eval_binding => lambda{ Pry.th[:pry].current_context })
|
||||
Bond.complete(:on => /\A/) do |input|
|
||||
Pry.commands.complete(input.line,
|
||||
:pry_instance => Pry.th[:pry],
|
||||
:target => Pry.th[:pry].current_context,
|
||||
:command_set => Pry.th[:pry].commands)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# Implements tab completion for Readline in Pry
|
||||
|
|
Loading…
Reference in a new issue