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

Indentation should consider line number character count. #7244

Merged
merged 1 commit into from Aug 15, 2012

Conversation

lucasuyezu
Copy link
Contributor

If you have an error page that shows lines 8-12 for example, the source would not be aligned properly from line 10 onwards.

This commit fixes that.

@rafaelfranca
Copy link
Member

Could you take a screenshot of the before and after this commit?

Also, is possible to add tests to this?

@rafaelfranca
Copy link
Member

I'm asking this because I didn't get the issue that you are fixing here.

@lucasuyezu
Copy link
Contributor Author

No prob. I'll make a new rails app to grab the screenshots and I'll upload asap.

@lucasuyezu
Copy link
Contributor Author

Hi.

I have uploaded a screenshot of the before: http://i.imgur.com/ba82I.png
I also have added some tests to it. They show how it will render the lines from now on.

Please let me know if you need anything else.

@lucasuyezu
Copy link
Contributor Author

Any updates on this @rafaelfranca ? Would you like me to add anything more?

@rafaelfranca
Copy link
Member

I'll take a look today.

@carlosantoniodasilva
Copy link
Member

Please squash your commits, thanks.

@lucasuyezu
Copy link
Contributor Author

@carlosantoniodasilva @rafaelfranca Commits are squashed. Please let me know if you guys need anything else.

@carlosantoniodasilva
Copy link
Member

@lucasuyezu looks good, thanks!

carlosantoniodasilva added a commit that referenced this pull request Aug 15, 2012
Fix indentation on template errors to consider line number character count.

For instance, when an error is shown, if the related source code snippet has line numbers from, lets say, 8-12, the lines are left aligned, which means the code indent is wrong:

    8: foo
    9: bar
    10: raise
    11: baz
    12: ...

This changes it to right align the source code snippet, so that the indentation is correct:

     8: foo
     9: bar
    10: raise
    11: baz
    12: ...
@carlosantoniodasilva carlosantoniodasilva merged commit ebb4a3d into rails:master Aug 15, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants