Skip to content

Instantly share code, notes, and snippets.

@Mon-Ouie
Created October 28, 2011 15:46
Show Gist options
  • Save Mon-Ouie/1322585 to your computer and use it in GitHub Desktop.
Save Mon-Ouie/1322585 to your computer and use it in GitHub Desktop.
Changes in HEAD
Modified lib/pry/pry_instance.rb
diff --git a/lib/pry/pry_instance.rb b/lib/pry/pry_instance.rb
index 7510525..7f42f9c 100644
--- a/lib/pry/pry_instance.rb
+++ b/lib/pry/pry_instance.rb
@@ -208,9 +208,16 @@ class Pry
def re(target=TOPLEVEL_BINDING)
target = Pry.binding_for(target)
+ compl = Pry::InputCompleter.build_completion_proc(target,
+ instance_eval(&custom_completions))
+
if input == Readline
# Readline tab completion
- Readline.completion_proc = Pry::InputCompleter.build_completion_proc target, instance_eval(&custom_completions)
+ Readline.completion_proc = compl
+ elsif defined? Coolline and input.is_a? Coolline
+ input.completion_proc = proc do |cool|
+ compl.call cool.completed_word
+ end
end
# It's not actually redundant to inject them continually as we may have
@@ -416,6 +423,10 @@ class Pry
line = input.readline(current_prompt, false)
Pry.history << line.dup if line
line
+ elsif defined? Coolline and input.is_a? Coolline
+ line = input.readline(current_prompt)
+ Pry.history << line.dup if line
+ line
else
if input.method(:readline).arity == 1
input.readline(current_prompt)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment