mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-12-23 08:47:50 +00:00
fix: terminates math calls before identifier start (#1117)
This commit is contained in:
parent
b7feb5dcca
commit
a00e5f12e5
4 changed files with 19 additions and 1 deletions
|
|
@ -1430,7 +1430,7 @@ const mathFuncCallOrPropAccess = (): textmate.Pattern => {
|
|||
begin: lookAhead(
|
||||
new RegExp(/(\.)?/.source + MATH_IDENTIFIER.source + /(?=\(|\[)/.source)
|
||||
),
|
||||
end: /(?:(?<=\)|\])(?:(?![\[\(\.])|$))|(?=[\s;\,\}\]\)]|$)/,
|
||||
end: /(?:(?<=\)|\])(?:(?![\[\(\.\p{XID_Start}])|$))|(?=[\s;,\}\]\)]|$)/u,
|
||||
patterns: [
|
||||
{
|
||||
match: /\./,
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
>
|
||||
>// todo: solve it in future
|
||||
#^^ source.typst comment.line.double-slash.typst punctuation.definition.comment.typst
|
||||
# ^^^^^^^^^^^^^^^^^^^^^^^^^ source.typst comment.line.double-slash.typst
|
||||
>#math.abs/**/()
|
||||
#^ source.typst variable.other.readwrite.hash.typst
|
||||
# ^^^^ source.typst variable.other.readwrite.typst
|
||||
|
|
|
|||
1
syntaxes/textmate/tests/unit/math/consecutive-call.typ
Normal file
1
syntaxes/textmate/tests/unit/math/consecutive-call.typ
Normal file
|
|
@ -0,0 +1 @@
|
|||
$upright(A)upright(m)$ "Test it."
|
||||
13
syntaxes/textmate/tests/unit/math/consecutive-call.typ.snap
Normal file
13
syntaxes/textmate/tests/unit/math/consecutive-call.typ.snap
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
>$upright(A)upright(m)$ "Test it."
|
||||
#^ source.typst markup.math.typst punctuation.definition.string.math.typst
|
||||
# ^^^^^^^ source.typst markup.math.typst meta.expr.call.typst entity.name.function.typst
|
||||
# ^ source.typst markup.math.typst meta.expr.call.typst meta.brace.round.typst
|
||||
# ^ source.typst markup.math.typst meta.expr.call.typst
|
||||
# ^ source.typst markup.math.typst meta.expr.call.typst meta.brace.round.typst
|
||||
# ^^^^^^^ source.typst markup.math.typst meta.expr.call.typst entity.name.function.typst
|
||||
# ^ source.typst markup.math.typst meta.expr.call.typst meta.brace.round.typst
|
||||
# ^ source.typst markup.math.typst meta.expr.call.typst
|
||||
# ^ source.typst markup.math.typst meta.expr.call.typst meta.brace.round.typst
|
||||
# ^ source.typst markup.math.typst punctuation.definition.string.math.typst
|
||||
# ^^^^^^^^^^^^ source.typst
|
||||
>
|
||||
Loading…
Add table
Add a link
Reference in a new issue