From c6536797d22e02e9fcc37bf806df018ae5aa89dc Mon Sep 17 00:00:00 2001 From: mkorje Date: Tue, 25 Mar 2025 23:48:54 +1100 Subject: [PATCH] Use element specific terminology in warning --- crates/typst-layout/src/math/mat.rs | 6 +++++- tests/suite/math/cases.typ | 2 +- tests/suite/math/vec.typ | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/crates/typst-layout/src/math/mat.rs b/crates/typst-layout/src/math/mat.rs index d3997f5b9..d678f8658 100644 --- a/crates/typst-layout/src/math/mat.rs +++ b/crates/typst-layout/src/math/mat.rs @@ -35,6 +35,7 @@ pub fn layout_vec( None, Axes::with_y(elem.gap(styles)), span, + "elements", )?; let delim = elem.delim(styles); @@ -60,6 +61,7 @@ pub fn layout_cases( None, Axes::with_y(elem.gap(styles)), span, + "branches", )?; let delim = elem.delim(styles); @@ -119,6 +121,7 @@ pub fn layout_mat( augment, Axes::new(elem.column_gap(styles), elem.row_gap(styles)), span, + "cells", )?; let delim = elem.delim(styles); @@ -136,6 +139,7 @@ fn layout_body( augment: Option>, gap: Axes>, span: Span, + children: &str, ) -> SourceResult { let nrows = columns.first().map_or(0, |col| col.len()); let ncols = columns.len(); @@ -193,7 +197,7 @@ fn layout_body( if cell.is_multiline() { ctx.engine.sink.warn(warning!( cell_span, - "linebreaks are ignored in cells"; + "linebreaks are ignored in {}", children; hint: "use commas instead to separate each line" )); } diff --git a/tests/suite/math/cases.typ b/tests/suite/math/cases.typ index 48a6cd2cf..306c1ae80 100644 --- a/tests/suite/math/cases.typ +++ b/tests/suite/math/cases.typ @@ -17,6 +17,6 @@ $ x = cases(1, 2) $ $ cases(a, b, c) $ --- math-cases-linebreaks --- -// Warning: 40-49 linebreaks are ignored in cells +// Warning: 40-49 linebreaks are ignored in branches // Hint: 40-49 use commas instead to separate each line $ cases(a, b, c) cases(reverse: #true, a \ b \ c) $ diff --git a/tests/suite/math/vec.typ b/tests/suite/math/vec.typ index c087bb59c..e5ee409ec 100644 --- a/tests/suite/math/vec.typ +++ b/tests/suite/math/vec.typ @@ -51,6 +51,6 @@ $ vec(1, 2) $ #set math.vec(delim: (none, "%")) --- math-vec-linebreaks --- -// Warning: 20-29 linebreaks are ignored in cells +// Warning: 20-29 linebreaks are ignored in elements // Hint: 20-29 use commas instead to separate each line $ vec(a, b, c) vec(a \ b \ c) $