-
-
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
Column numbers for --format emacs should start at 1 #276
Comments
That's odd. Columns in Emacs certainly start from 0. |
Well the displayed column numbers start at 0 in mine too (which is 23.1.1), but |
I guess you're right. Maybe we should count columns from 1 everywhere for consistency. Btw, @whitequark, why are line-numbers in Parser starting from 1 and column numbers starting from 0? |
Column numbers are used to highlight ranges, so they represent real ranges of indexes for the lines. Reported line numbers on the other hand are not inherently bound to something real, like an actual line number, because you can specify starting line in the Source::Buffer constructor. (This is used to implement the eval family of functions, where starting line is a parameter.) |
I find it strange that emacs places the cursor as if column numbers would start at 1 while it displays them starting at 0. See how it says If we are to adapt to this quirk, my choice would be to do it only in the emacs formatter. I don't know if people use |
Well, the |
So, vim starts counting columns from 1 it would seem. Emacs's behaviour is extra strange because the command @jonas054 Would you please take care of that? |
Yes. I'll add 1 to the column number in all formatters. |
When I run
rubocop
as a compilation within emacs and then use the(next-error)
function to jump to offences, the cursor does not go to the right column. For column 0 it goes to the end of the line, and for all other column values it ends up one step too far to the left.If this is the same for other users, I suggest we add 1 to the column number in the emacs formatter.
The text was updated successfully, but these errors were encountered: