actually use tab-corrected column indices in diagnostic output

This commit is contained in:
Michael Sippel 2024-10-04 02:08:21 +02:00
parent ce3967c2de
commit 0cbbcd5b24
Signed by: senvas
GPG key ID: F96CF119C34B64A6

View file

@ -20,8 +20,8 @@ pub fn print_diagnostic(
let mut line_region = InputRegionTag::default();
let n_before = 3;
let n_after = 3;
let n_before = 5;
let n_after = 5;
let mut last_lines = Vec::new();
let mut next_lines = 0;
@ -67,8 +67,8 @@ pub fn print_diagnostic(
}
print!("\t{}", "|".bright_magenta());
for _ in 0..column_begin { print!("{}", ".".magenta().bold()); }
for _ in column_begin..column_end { print!("{}", "^".magenta().bold()); }
for _ in 0..column_begin_c { print!("{}", ".".magenta().bold()); }
for _ in column_begin_c..column_end_c { print!("{}", "^".magenta().bold()); }
print!("\n");
print!("{} [{}-{}]: {}\n", "error".bright_red(), column_begin, column_end, message.yellow());