in case of error return a range of chars position instead of one line and column

This commit is contained in:
Irevoire 2021-11-09 10:27:29 +01:00
parent 2c6d08c519
commit 9b24f83456
No known key found for this signature in database
GPG Key ID: 7A6A970C96104F1B

View File

@ -146,12 +146,8 @@ impl<'a> Display for Error<'a> {
)?,
ErrorKind::External(ref error) => writeln!(f, "{}", error)?,
}
write!(
f,
"{}:{} in `{}`.",
self.context.location_line(),
self.context.get_utf8_column(),
self.context.extra,
)
let base_column = self.context.get_utf8_column();
let size = self.context.fragment().chars().count();
write!(f, "{}:{} in `{}`.", base_column, base_column + size, self.context.extra,)
}
}