TimKam / atomic-vale

a vale linter plugin for Atom
MIT License
6 stars 2 forks source link

Column index is off by one #4

Closed jdkato closed 7 years ago

jdkato commented 7 years ago

I noticed that the column index is one higher than it should be. For example, a Markdown document with the following text:

This is a very interesting sentence!

yields

example.md:1:11:vale.Editorializing:Consider removing 'very'

from Vale, but I get 1:12 in Atom.

I think the issue is that Atom's columns are zero-indexed. So,

range: [
    [atomMessageLine, message.Span[0] - 1]
    [atomMessageLine, message.Span[1]]
]

should fix it.

Thanks for your work on this plugin!

TimKam commented 7 years ago

Thanks for reporting. Seems that it occurs since 1.1 release. Will fix it asap.

TimKam commented 7 years ago

Actually, I consider the difference and set atomMessageLine = message.Line - 1. I also can't reproduce the issue locally.

jdkato commented 7 years ago

Hmm, that's interesting. For what it's worth, here's what I'm seeing (on v1.2.0 and Vale 0.4.0):

demo

(Note that the "v" in "very" isn't underlined and the location is 1:12.)

TimKam commented 7 years ago

Sorry, my bad. I was looking and the line index. Thanks!