This commit is contained in:
afonya2 2025-06-11 14:20:57 +02:00
parent 74fa0a8523
commit 0e0fee425a
Signed by: afonya
GPG key ID: EBB9C4CAFAAFB2DC
2 changed files with 10 additions and 4 deletions

View file

@ -132,14 +132,14 @@ pub fn create_error(message: &str, position: usize, typ: ErrorType, stype: Error
fn get_exact_pos(file: &String, pos: usize) -> (usize, usize) {
let mut line = 1;
let mut column = 1;
let mut column = 0;
for (i, c) in file.char_indices() {
if i == pos {
return (line, column);
}
if c == '\n' {
line += 1;
column = 1;
column = 0;
} else {
column += 1;
}