diff options
| author | Sébastien d'Herbais de Thun <sebastien.d.herbais@gmail.com> | 2024-11-26 21:51:46 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-26 20:51:46 +0000 |
| commit | 85d3a49a1a0bd50556b8b724a15aa29b074a2db7 (patch) | |
| tree | bbce57ce9e782d28ea10e148027aa25198958384 /crates/typst-library/src/introspection | |
| parent | 8fe8b2a23940f76077aa36eda305febd22e7cadc (diff) | |
Added warning when explicit return in code (not markup) discards joined content (#5413)
Co-authored-by: Laurenz <laurmaedje@gmail.com>
Diffstat (limited to 'crates/typst-library/src/introspection')
| -rw-r--r-- | crates/typst-library/src/introspection/counter.rs | 5 | ||||
| -rw-r--r-- | crates/typst-library/src/introspection/state.rs | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/crates/typst-library/src/introspection/counter.rs b/crates/typst-library/src/introspection/counter.rs index 2e7180c6..b884844c 100644 --- a/crates/typst-library/src/introspection/counter.rs +++ b/crates/typst-library/src/introspection/counter.rs @@ -393,6 +393,11 @@ impl Counter { let context = Context::new(Some(location), styles); state.display(engine, context.track(), &numbering) } + + /// Selects all state updates. + pub fn select_any() -> Selector { + CounterUpdateElem::elem().select() + } } #[scope] diff --git a/crates/typst-library/src/introspection/state.rs b/crates/typst-library/src/introspection/state.rs index 62aba5ff..772a4fbf 100644 --- a/crates/typst-library/src/introspection/state.rs +++ b/crates/typst-library/src/introspection/state.rs @@ -261,6 +261,11 @@ impl State { fn selector(&self) -> Selector { select_where!(StateUpdateElem, Key => self.key.clone()) } + + /// Selects all state updates. + pub fn select_any() -> Selector { + StateUpdateElem::elem().select() + } } #[scope] |
