Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 695e428

Browse files
fix: Fix bug in origin location computation
1 parent 15e503f commit 695e428

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

‎src/renderer/display_list.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1149,7 +1149,7 @@ fn format_header<'a>(
11491149
..
11501150
} = item
11511151
{
1152-
if main_range >= range.0 && main_range <= range.1 + end_line.len() {
1152+
if main_range >= range.0 && main_range < range.1 + max(*end_line asusize,1) {
11531153
let char_column = text[0..(main_range - range.0).min(text.len())]
11541154
.chars()
11551155
.count();

‎tests/formatter.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ fn origin_correct_start_line() {
918918

919919
let expected = str![[r#"
920920
error: title
921-
--> origin.txt:2:4
921+
--> origin.txt:3:1
922922
|
923923
1 | aaa
924924
2 | bbb

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /