We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent da74a7f commit 4616117Copy full SHA for 4616117
src/comp/syntax/codemap.rs
@@ -143,7 +143,7 @@ fn lookup_byte_offset(cm: codemap::codemap, chpos: uint)
143
{
144
fn lookup(pos: file_pos) -> uint { ret pos.ch; }
145
let {fm,line} = option::get(lookup_line(cm,chpos,lookup));
146
- let line_offset = fm.lines[line].byte;
+ let line_offset = fm.lines[line].byte - fm.start_pos.byte;
147
let col = chpos - fm.lines[line].ch;
148
let col_offset = str::byte_len_range(*fm.src, line_offset, col);
149
ret {fm: fm, pos: line_offset + col_offset};
0 commit comments