-
Notifications
You must be signed in to change notification settings - Fork 44
Column number should start at 1 and not 0 #17
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
Comments
I just run across this issue as well. It also affects editors like VS Code that parse console output for expressions of the form I think the fix is the following (in from_snippet.rs:95) but I don't know what needs fixing for tests and such: let mut col = 1;
let mut row = slice.line_start;
for item in body.iter() {
if let DisplayLine::Source {
line: DisplaySourceLine::Content { range, .. },
..
} = item
{
if annotation.range.0 >= range.0 && annotation.range.0 <= range.1 {
println!("hi");
- col = annotation.range.0 - range.0;
+ col = annotation.range.0 - range.0 + 1;
break;
}
row += 1;
}
} |
GodTamIt
added a commit
to GodTamIt/annotate-snippets-rs
that referenced
this issue
Jan 12, 2020
This is a small change to start column numbers from 1 instead of 0. Issue: rust-lang#17
Should be fixed with #22 landing now. Closing this. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Given this code:
This results in the following output:
Because the output should be for humans, shouldn't the location be
chris.beep:26:14
?The text was updated successfully, but these errors were encountered: