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:
parent
8cf350436e
commit
bb5745aa55
1 changed files with 7 additions and 1 deletions
|
@ -60,7 +60,13 @@ class Pry::InputCompleter
|
||||||
if path.call.empty?
|
if path.call.empty?
|
||||||
target = options[:target]
|
target = options[:target]
|
||||||
else
|
else
|
||||||
target = Pry::ObjectPath.new(path.call, @pry.binding_stack).resolve.last
|
# Assume the user is tab-completing the 'cd' command
|
||||||
|
begin
|
||||||
|
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
|
||||||
|
|
Loading…
Reference in a new issue