Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception line numbers do not match prompt line numbers. #2269

Open
martinos opened this issue Jan 12, 2023 · 2 comments
Open

Exception line numbers do not match prompt line numbers. #2269

martinos opened this issue Jan 12, 2023 · 2 comments

Comments

@martinos
Copy link

martinos commented Jan 12, 2023

I work a lot with pry on a day to day basis and I really love it, I often cut and paste code in the console and when I get an exception, the line numbers do not match the prompt. When you paste large code parts, it gets quite hard to match the stacktrace line numbers with the prompt line numbers.

I have read a part of the documentation and it does not appear to me that this is possible (not sure though). Can someone help me on this?

This would be super helpful.

@andrehjr
Copy link
Member

Hi, thanks for opening the issue!

To make sure I understand this clearly. Can you add more details on how to reproduce so I can see issue happening? Maybe a recording or just paste it on the issue

@martinos
Copy link
Author

martinos commented Jan 12, 2023

Sorry, I should have done that before:

[11] pry(main)> 1.times do |a|
[11] pry(main)*   "asdf"
[11] pry(main)*   "asdf"
[11] pry(main)*   "asdf"
[11] pry(main)*   "asdf"
[11] pry(main)*   "asdf"
[11] pry(main)*   "asdf"
[11] pry(main)*   "asdf"
[11] pry(main)*   raise "ERROR"
[11] pry(main)* end
RuntimeError: ERROR
from (pry):39:in `block in __pry__'

The exception message says that the error is on line 39, but there's no way to match this with the code that I've just pasted in the console.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants