We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 09afd00 commit 87c8d40Copy full SHA for 87c8d40
src/renderer/display_list.rs
@@ -1149,7 +1149,7 @@ fn format_header<'a>(
1149
..
1150
} = item
1151
{
1152
- if main_range >= range.0 && main_range <= range.1 + end_line.len() {
+ if main_range >= range.0 && main_range < range.1 + max(*end_line as usize, 1) {
1153
let char_column = text[0..(main_range - range.0).min(text.len())]
1154
.chars()
1155
.count();
tests/formatter.rs
@@ -918,7 +918,7 @@ fn origin_correct_start_line() {
918
919
let expected = str![[r#"
920
error: title
921
- --> origin.txt:2:4
+ --> origin.txt:3:1
922
|
923
1 | aaa
924
2 | bbb
0 commit comments