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 numbers are off #259

Closed
steven807 opened this issue May 27, 2021 · 3 comments · Fixed by #260
Closed

line numbers are off #259

steven807 opened this issue May 27, 2021 · 3 comments · Fixed by #260
Labels
C-bug Category: bug

Comments

@steven807
Copy link

Nifty! But errors after the first (even across files) seem to be listed on the wrong line numbers -- they are earlier than reported.
(Sorry, I don't have a reproducible case. But when I ran it on a code base, I found this immediately.)

@epage epage added the C-bug Category: bug label May 27, 2021
@epage
Copy link
Collaborator

epage commented May 27, 2021

Thanks for reporting this!

I was able to reproduce it. The first couple of cases I checked were off by 1 but after enough cases, I found one off by 3. Mostly noticing this so I don't forget and look in the wrong place

@epage
Copy link
Collaborator

epage commented May 27, 2021

It looks like we start off by 1 line and then increase by 1 for each new typo found.

epage pushed a commit to epage/typos that referenced this issue May 27, 2021
I didn't count on how `buffer.lines().count()` would handle different
corner cases, like slices with no `\n`, slices with trailing `\n`, etc.

Fixes crate-ci#259
@epage
Copy link
Collaborator

epage commented May 27, 2021

v1.0.1 is now published with this fix. Pre-built binaries will be uploaded to Github as the CI gets to them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants