The commits in this branch would conflict with the current ones in the master
branch. I've modified the code of pry/completion.rb so that instead of escaping
*all* input it will only escape it when this hasn't already been done so.
This fixes#601.
Signed-off-by: Yorick Peterse <yorickpeterse@gmail.com>
Pry is now able to complete variable names for instance and class variables, as
well as being able to complete methods and the like on these variables.
Signed-off-by: Yorick Peterse <yorickpeterse@gmail.com>
User input should be escaped using Regexp.escape() before trying to figure out
what data to use for the Readline completion system. Not escaping this input
would cause Pry to fail for input such as `[10, 20].map(&:class)`.
This problem was caused due to lib/completion.rb converting the input (in this
case it would be ":class)") to a Regexp object. Because this, when converted to
a Regexp object, is invalid it would cause Pry to throw a RegexpError error and
bail out.
See #601 for more information.
Signed-off-by: Yorick Peterse <yorickpeterse@gmail.com>