mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
Added checks for Coolline
This commit is contained in:
parent
c567effb10
commit
3e848fa5f9
1 changed files with 11 additions and 3 deletions
|
@ -215,9 +215,15 @@ class Pry
|
|||
def re(target=TOPLEVEL_BINDING)
|
||||
target = Pry.binding_for(target)
|
||||
|
||||
if input.respond_to?(:completion_proc=)
|
||||
# Readline tab completion
|
||||
input.completion_proc = Pry::InputCompleter.build_completion_proc target, instance_eval(&custom_completions)
|
||||
compl = Pry::InputCompleter.build_completion_proc(target,
|
||||
instance_eval(&custom_completions))
|
||||
|
||||
if defined? Coolline and input.is_a? Coolline
|
||||
input.completion_proc = proc do |cool|
|
||||
compl.call cool.completed_word
|
||||
end
|
||||
elsif input.respond_to? :completion_proc=
|
||||
input.completion_proc = compl
|
||||
end
|
||||
|
||||
# It's not actually redundant to inject them continually as we may have
|
||||
|
@ -452,6 +458,8 @@ class Pry
|
|||
handle_read_errors do
|
||||
if input == Readline
|
||||
input.readline(current_prompt, false) # false since we'll add it manually
|
||||
elsif defined? Coolline and input.is_a? Coolline
|
||||
input.readline(current_prompt)
|
||||
else
|
||||
if input.method(:readline).arity == 1
|
||||
input.readline(current_prompt)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue