summaryrefslogtreecommitdiff
path: root/library/src/meta/context.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-06-12 15:40:43 +0200
committerLaurenz <laurmaedje@gmail.com>2023-06-12 15:42:01 +0200
commit378ebe5f5601f11c3f428c17bed492012feb251e (patch)
tree4530bf009844faca40ca4fd6d0b9251fd51ef587 /library/src/meta/context.rs
parent19bf1f58944a42f17903869c162a33aba22b80b0 (diff)
Delayed errors
Fixes #785. Thanks to @Dherse for the idea!
Diffstat (limited to 'library/src/meta/context.rs')
-rw-r--r--library/src/meta/context.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/library/src/meta/context.rs b/library/src/meta/context.rs
index d599c63e..2ed359ee 100644
--- a/library/src/meta/context.rs
+++ b/library/src/meta/context.rs
@@ -73,12 +73,10 @@ struct LocateElem {
impl Show for LocateElem {
#[tracing::instrument(name = "LocateElem::show", skip(self, vt))]
fn show(&self, vt: &mut Vt, _: StyleChain) -> SourceResult<Content> {
- if !vt.introspector.init() {
- return Ok(Content::empty());
- }
-
- let location = self.0.location().unwrap();
- Ok(self.func().call_vt(vt, [location])?.display())
+ Ok(vt.delayed(|vt| {
+ let location = self.0.location().unwrap();
+ Ok(self.func().call_vt(vt, [location])?.display())
+ }))
}
}