Skip to content

Commit 435da66

Browse files
authored
Merge pull request #22 from GodTamIt/fix-col-num
Start column numbers from 1
2 parents 39df7c1 + 113f257 commit 435da66

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/display_list/from_snippet.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ fn format_header(
9292
} = item
9393
{
9494
if annotation.range.0 >= range.0 && annotation.range.0 <= range.1 {
95-
col = annotation.range.0 - range.0;
95+
col = annotation.range.0 - range.0 + 1;
9696
break;
9797
}
9898
row += 1;

tests/fixtures/no-color/multiline_annotation.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0308]: mismatched types
2-
--> src/format.rs:51:5
2+
--> src/format.rs:51:6
33
|
44
51 | ) -> Option<String> {
55
| -------------- expected `std::option::Option<std::string::String>` because of return type

tests/fixtures/no-color/multiline_annotation2.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0027]: pattern does not mention fields `lineno`, `content`
2-
--> src/display_list.rs:139:31
2+
--> src/display_list.rs:139:32
33
|
44
139 | if let DisplayLine::Source {
55
| ________________________________^

tests/fixtures/no-color/simple.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: expected one of `.`, `;`, `?`, or an operator, found `for`
2-
--> src/format_color.rs:171:8
2+
--> src/format_color.rs:171:9
33
|
44
169 | })
55
| - expected one of `.`, `;`, `?`, or an operator here

0 commit comments

Comments
 (0)