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

Line number in errors is relative to function instead of the whole file. #30

Open
ThibH opened this issue Jan 25, 2017 · 2 comments
Open

Comments

@ThibH
Copy link

ThibH commented Jan 25, 2017

For example I get an error:

# Error: list index out of range
# Traceback (most recent call last):
#   File "<string>", line 72, in submit
# IndexError: list index out of range # 

But it's in fact line 72 considering that line 0 is at the beginning of the submit function. The real line number was in fact 121.

@justinfx
Copy link
Owner

This is a problem when used selected text to Maya instead of the whole file. The exception comes from Maya and not Sublime, so Maya only knows the chunk of text that you sent it. I am not sure how to go about faking this unless we ship back serialized traceback details to reformat, or we parse the traceback text and reformat the location information.

@justinfx
Copy link
Owner

Maybe we could send the selected text padded by newlines to fake it to match the offset in the source file.

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

No branches or pull requests

2 participants