Use relative positions inside a SourceFile.
This commit is contained in:
parent
585bb5e68d
commit
258ace613d
20 changed files with 217 additions and 281 deletions
|
@ -267,7 +267,7 @@ impl CodegenCx<'_, '_> {
|
|||
|
||||
// Use 1-based indexing.
|
||||
let line = (line + 1) as u32;
|
||||
let col = (pos - line_pos).to_u32() + 1;
|
||||
let col = (file.relative_position(pos) - line_pos).to_u32() + 1;
|
||||
|
||||
(file, line, col)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue