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
|
module BondCompleter
|
||||||
|
|
||||||
def self.build_completion_proc(target, pry=nil, commands=[""])
|
def self.build_completion_proc(target, pry=nil, commands=[""])
|
||||||
Bond.restart(:eval_binding => lambda{ pry.current_context })
|
Pry.th[:pry] = pry
|
||||||
Bond.complete(:on => /\A/) do |input|
|
|
||||||
Pry.commands.complete(input.line,
|
|
||||||
:pry_instance => pry,
|
|
||||||
:target => pry.current_context,
|
|
||||||
:command_set => pry.commands)
|
|
||||||
end
|
|
||||||
|
|
||||||
proc{ |*a| Bond.agent.call(*a) }
|
proc{ |*a| Bond.agent.call(*a) }
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
# Implements tab completion for Readline in Pry
|
# Implements tab completion for Readline in Pry
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue