summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorMartin Haug <mhaug@live.de>2022-06-01 16:57:38 +0200
committerGitHub <noreply@github.com>2022-06-01 16:57:38 +0200
commita937462491a63f5cff3551b5bb8bc45fb350f0b6 (patch)
tree7916fca31328fef3e21d3bd62eca132369da81b0 /src/main.rs
parent665ed12825918bd02a6d6dbcb67860a83dd41600 (diff)
parentaf10b08cc1bd5ef78c5c048a0cbc83b123f1ffd4 (diff)
Merge pull request #73 from typst/span-numbers
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index 33302eee..d518a03b 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -240,7 +240,7 @@ fn print_diagnostics(
for error in errors {
// The main diagnostic.
let diag = Diagnostic::error().with_message(error.message).with_labels(vec![
- Label::primary(error.span.source, error.span.to_range()),
+ Label::primary(error.span.source(), sources.range(error.span)),
]);
term::emit(&mut w, &config, sources, &diag)?;
@@ -249,7 +249,7 @@ fn print_diagnostics(
for point in error.trace {
let message = point.v.to_string();
let help = Diagnostic::help().with_message(message).with_labels(vec![
- Label::primary(point.span.source, point.span.to_range()),
+ Label::primary(point.span.source(), sources.range(point.span)),
]);
term::emit(&mut w, &config, sources, &help)?;