-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Style/IndentationWidth fails with BOM set by Vim #2703
Comments
Attaching the file was a nice idea. Thanks. This is probably my fault, so I'll try to fix it. |
@whitequark Is there any chance |
Easiest way to do this would be to eat the BOM in |
The function of BOM is fundamentally the same as the encoding comment. We don't mangle the encoding comment, I don't see a reason to mangle BOM either. |
If you don't want to mangle it, that's fine. However, one important difference is that the BOM is invisible when viewed in a text editor. So when people call |
What you want to display is the number of grapheme clusters since the beginning of the line. Use one of the multitude of gems that implement UCD lookups to calculate the number of grapheme clusters. This is not the job of Parser. |
Very well. |
@jonas054 Looks like you will have to special-case this in |
@alexdowad Fair enough. @whitequark Thanks for the thorough explanation. |
[Fix #2703] Calculate column on first line when BOM is present
if you use
:set bomb
in vim to add BOM to an utf-8 encoded file, rubocop starts failing.Aparently it is detecting the BOM char as an extra space in the first line.
I've attached a file that reproduces this issue:
test.rb.zip
The text was updated successfully, but these errors were encountered: