Skip to content

Commit 9a22e4e

Browse files
committed
Error format more like dart-sass.
1 parent df5984e commit 9a22e4e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Diff for: src/error.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,10 @@ impl fmt::Display for Error {
7070
let line_no = pos.line_no.to_string();
7171
write!(
7272
out,
73-
"{0:lnw$} ,\
73+
"{msg}\
74+
\n{0:lnw$} ,\
7475
\n{ln} | {line}\
75-
\n{0:lnw$} |{0:>lpos$}^ {msg}\
76+
\n{0:lnw$} |{0:>lpos$}^\
7677
\n{0:lnw$} '",
7778
"",
7879
line = pos.line,
@@ -90,7 +91,7 @@ impl fmt::Display for Error {
9091
lnw = line_no.len(),
9192
file = pos.file.name(),
9293
row = pos.line_no,
93-
col = pos.line_pos - 1,
94+
col = pos.line_pos,
9495
cause = if pos.file.imported_from().is_some() {
9596
"import"
9697
} else {

0 commit comments

Comments
 (0)