diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-01-28 12:01:05 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-01-28 12:14:03 +0100 |
| commit | 28c554ec2185a15e22f0408ce485ed4afe035e03 (patch) | |
| tree | 622d2d281133c4e6b92633e44bfc1e1301250fb4 /src/model/library.rs | |
| parent | 23238d4d44881a5b466ab23a32e2a7447f460127 (diff) | |
Rework math attachments and accents
Diffstat (limited to 'src/model/library.rs')
| -rw-r--r-- | src/model/library.rs | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/model/library.rs b/src/model/library.rs index 773342b3..4208a4c7 100644 --- a/src/model/library.rs +++ b/src/model/library.rs @@ -71,12 +71,13 @@ pub struct LangItems { pub math_atom: fn(atom: EcoString) -> Content, /// An alignment point in a formula: `&`. pub math_align_point: fn() -> Content, - /// A subsection in a math formula that is surrounded by matched delimiters: - /// `[x + y]`. + /// Matched delimiters surrounding math in a formula: `[x + y]`. pub math_delimited: fn(open: Content, body: Content, close: Content) -> Content, - /// A base with optional sub- and superscripts in a formula: `a_1^2`. - pub math_script: - fn(base: Content, sub: Option<Content>, sup: Option<Content>) -> Content, + /// A base with optional attachments in a formula: `a_1^2`. + pub math_attach: + fn(base: Content, bottom: Option<Content>, top: Option<Content>) -> Content, + /// A base with an accent: `arrow(x)`. + pub math_accent: fn(base: Content, accent: char) -> Content, /// A fraction in a formula: `x/2`. pub math_frac: fn(num: Content, denom: Content) -> Content, } @@ -95,6 +96,8 @@ impl Hash for LangItems { self.space.hash(state); self.linebreak.hash(state); self.text.hash(state); + self.text_id.hash(state); + (self.text_str as usize).hash(state); self.smart_quote.hash(state); self.parbreak.hash(state); self.strong.hash(state); @@ -108,9 +111,11 @@ impl Hash for LangItems { self.term_item.hash(state); self.formula.hash(state); self.math_atom.hash(state); - self.math_script.hash(state); - self.math_frac.hash(state); self.math_align_point.hash(state); + self.math_delimited.hash(state); + self.math_attach.hash(state); + self.math_accent.hash(state); + self.math_frac.hash(state); } } |
