add option to disable to the input completer (ref #1123).

This commit is contained in:
Robert Gleeson 2014-02-03 19:28:47 +01:00
parent 044ddd4b0d
commit 247e4af83c
2 changed files with 3 additions and 0 deletions

View File

@ -23,6 +23,7 @@
* `whereami` is now aliased to `@`
* default configuration(Pry.config) lazy loads its values. (#1096)
* require of 'readline' is delayed until Pry.start() has been called for the first time. (#1117)
* add option to disable input completer through `_pry_.config.completer = nil`
#### Bug fixes, etc.
* `binding.pry` inside `.pryrc` file now works, with some limitations (@richo / #1118)

View File

@ -40,6 +40,7 @@ class Pry
extend Pry::Config::Convenience
config_shortcut *Pry::Config.shortcuts
EMPTY_COMPLETIONS = [].freeze
# Create a new {Pry} instance.
# @param [Hash] options
@ -131,6 +132,7 @@ class Pry
# @param [String] input What the user has typed so far
# @return [Array<String>] Possible completions
def complete(input)
return EMPTY_COMPLETIONS unless config.completer
Pry.critical_section do
config.completer.call input, :target => current_binding,
:pry => self,