mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
Manually merged branch "issue/601".
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>
This commit is contained in:
commit
3fa74ea862
2 changed files with 9 additions and 1 deletions
|
@ -74,8 +74,9 @@ class Pry
|
|||
when /^(:[^:.]*)$/
|
||||
# Symbol
|
||||
if Symbol.respond_to?(:all_symbols)
|
||||
sym = $1
|
||||
sym = Regexp.quote($1)
|
||||
candidates = Symbol.all_symbols.collect{|s| ":" + s.id2name}
|
||||
|
||||
candidates.grep(/^#{sym}/)
|
||||
else
|
||||
[]
|
||||
|
|
|
@ -23,6 +23,13 @@ describe Pry::InputCompleter do
|
|||
end
|
||||
end
|
||||
|
||||
it 'should take parenthesis and other characters into account for symbols' do
|
||||
b = Pry.binding_for(Object.new)
|
||||
completer = Pry::InputCompleter.build_completion_proc(b)
|
||||
|
||||
lambda { completer.call(":class)") }.should.not.raise(RegexpError)
|
||||
end
|
||||
|
||||
it 'should complete instance variables' do
|
||||
object = Object.new
|
||||
|
||||
|
|
Loading…
Reference in a new issue