Skip to content

Commit

Permalink
fix line number highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
lovasoa committed Jul 12, 2024
1 parent 0136776 commit 2ed1476
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/webserver/database/error_highlighting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ pub fn quote_source_with_highlight(source: &str, line_num: u64, col_num: u64) ->
.unwrap_or_default()
.saturating_sub(1);
for line in source.lines() {
current_line_num += 1;
if current_line_num + 1 == line_num || current_line_num == line_num + 1 {
writeln!(msg, "{line}").unwrap();
} else if current_line_num == line_num {
highlight_line_offset(&mut msg, line, col_num_usize);
} else if current_line_num > line_num + 1 {
break;
}
current_line_num += 1;
}
msg
}
Expand Down

0 comments on commit 2ed1476

Please sign in to comment.