add option to disable to the input completer (ref #1123).
This commit is contained in:
parent
044ddd4b0d
commit
247e4af83c
|
@ -23,6 +23,7 @@
|
||||||
* `whereami` is now aliased to `@`
|
* `whereami` is now aliased to `@`
|
||||||
* default configuration(Pry.config) lazy loads its values. (#1096)
|
* 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)
|
* 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.
|
#### Bug fixes, etc.
|
||||||
* `binding.pry` inside `.pryrc` file now works, with some limitations (@richo / #1118)
|
* `binding.pry` inside `.pryrc` file now works, with some limitations (@richo / #1118)
|
||||||
|
|
|
@ -40,6 +40,7 @@ class Pry
|
||||||
|
|
||||||
extend Pry::Config::Convenience
|
extend Pry::Config::Convenience
|
||||||
config_shortcut *Pry::Config.shortcuts
|
config_shortcut *Pry::Config.shortcuts
|
||||||
|
EMPTY_COMPLETIONS = [].freeze
|
||||||
|
|
||||||
# Create a new {Pry} instance.
|
# Create a new {Pry} instance.
|
||||||
# @param [Hash] options
|
# @param [Hash] options
|
||||||
|
@ -131,6 +132,7 @@ class Pry
|
||||||
# @param [String] input What the user has typed so far
|
# @param [String] input What the user has typed so far
|
||||||
# @return [Array<String>] Possible completions
|
# @return [Array<String>] Possible completions
|
||||||
def complete(input)
|
def complete(input)
|
||||||
|
return EMPTY_COMPLETIONS unless config.completer
|
||||||
Pry.critical_section do
|
Pry.critical_section do
|
||||||
config.completer.call input, :target => current_binding,
|
config.completer.call input, :target => current_binding,
|
||||||
:pry => self,
|
:pry => self,
|
||||||
|
|
Loading…
Reference in New Issue