1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

Catch completion errors [Fixes #841]

This commit is contained in:
Conrad Irwin 2014-05-05 23:42:38 -07:00
parent 8cf350436e
commit bb5745aa55

View file

@ -60,7 +60,13 @@ class Pry::InputCompleter
if path.call.empty? if path.call.empty?
target = options[:target] target = options[:target]
else else
# Assume the user is tab-completing the 'cd' command
begin
target = Pry::ObjectPath.new(path.call, @pry.binding_stack).resolve.last target = Pry::ObjectPath.new(path.call, @pry.binding_stack).resolve.last
# but if that doesn't work, assume they're doing division with no spaces
rescue Pry::CommandError
target = options[:target]
end
end end
begin begin