mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
improved breaking up file:line syntax to take care of windows c:/blah.rb:10 edgecase
This commit is contained in:
parent
d209414ed9
commit
95cd5f4724
1 changed files with 5 additions and 1 deletions
|
@ -151,7 +151,11 @@ class Pry
|
|||
line = eval_string.lines.count + 1
|
||||
should_reload_locally = opts[:n] ? false : true
|
||||
else
|
||||
file_name, line = File.expand_path(args.first).split(/:/)
|
||||
# break up into file:line
|
||||
/(:(\d+))?$/ =~ File.expand_path(args.first)
|
||||
|
||||
# $` is pre-match
|
||||
file_name, line = [$`, $2]
|
||||
line = line ? line.to_i : opts[:l].to_i
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue