From c7846263eafefc141c88c3e6ad38de89508f5541 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Wed, 5 Sep 2012 23:14:53 -0700 Subject: [PATCH] Don't use bond with editline --- lib/pry.rb | 13 +++++-------- lib/pry/pry_class.rb | 6 ++++++ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/pry.rb b/lib/pry.rb index 3f5ff1e8..4eab6c92 100644 --- a/lib/pry.rb +++ b/lib/pry.rb @@ -204,6 +204,11 @@ if Pry::Helpers::BaseHelpers.windows? && !Pry::Helpers::BaseHelpers.windows_ansi end end +begin + require 'bond' +rescue LoadError +end + require 'pry/version' require 'pry/rbx_method' require 'pry/rbx_path' @@ -224,11 +229,3 @@ require 'pry/pry_class' require 'pry/pry_instance' require 'pry/cli' require 'pry/pager' - -begin - require 'bond' -rescue LoadError - Pry.config.completer = Pry::InputCompleter -else - Pry.config.completer = Pry::BondCompleter -end diff --git a/lib/pry/pry_class.rb b/lib/pry/pry_class.rb index 918342cc..47c9a2ad 100644 --- a/lib/pry/pry_class.rb +++ b/lib/pry/pry_class.rb @@ -265,6 +265,12 @@ class Pry config.correct_indent = true config.collision_warning = false + if defined?(Bond) && Readline::VERSION !~ /editline/i + config.completer = Pry::BondCompleter + else + config.completer = Pry::InputCompleter + end + config.gist ||= OpenStruct.new config.gist.inspecter = proc(&:pretty_inspect)