aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/parser.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/parser.rs b/src/parser.rs
index b7a810f..ab63e63 100644
--- a/src/parser.rs
+++ b/src/parser.rs
@@ -148,7 +148,7 @@ impl<'a> Parser<'a> {
pub fn to_linecol(&self, offset: usize) -> (usize, usize) {
let mut cur = 0;
for (i, line) in self.input.lines().enumerate() {
- if cur + line.len() > offset {
+ if cur + line.len() + 1 > offset {
return (i, offset - cur)
}
cur += line.len() + 1;