mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
allow Pry::Command.source to properly extract source for commands defined in REPL
This commit is contained in:
parent
3f7448ed4c
commit
d1222396e3
1 changed files with 2 additions and 1 deletions
|
@ -55,7 +55,8 @@ class Pry
|
|||
end
|
||||
|
||||
def source
|
||||
strip_leading_whitespace(block.source)
|
||||
file, line = block.source_location
|
||||
strip_leading_whitespace(Pry::Code.from_file(file).expression_at(line))
|
||||
end
|
||||
|
||||
def source_location
|
||||
|
|
Loading…
Reference in a new issue