mirror of https://github.com/stelzo/typst.git
Let test error hide line number if it's zero (#4535)
This commit is contained in:
parent
be516867c8
commit
ab5cebc57c
|
|
@ -48,7 +48,11 @@ impl FilePos {
|
||||||
|
|
||||||
impl Display for FilePos {
|
impl Display for FilePos {
|
||||||
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
|
||||||
write!(f, "{}:{}", self.path.display(), self.line)
|
if self.line > 0 {
|
||||||
|
write!(f, "{}:{}", self.path.display(), self.line)
|
||||||
|
} else {
|
||||||
|
write!(f, "{}", self.path.display())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue