diff --git a/syntaxes/textmate/main.mts b/syntaxes/textmate/main.mts index d17ea8f9b..f2941bfde 100644 --- a/syntaxes/textmate/main.mts +++ b/syntaxes/textmate/main.mts @@ -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: /\./, diff --git a/syntaxes/textmate/tests/unit/basic/call-comment.typ.snap b/syntaxes/textmate/tests/unit/basic/call-comment.typ.snap index e67d1ea6d..bc683551d 100644 --- a/syntaxes/textmate/tests/unit/basic/call-comment.typ.snap +++ b/syntaxes/textmate/tests/unit/basic/call-comment.typ.snap @@ -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 diff --git a/syntaxes/textmate/tests/unit/math/consecutive-call.typ b/syntaxes/textmate/tests/unit/math/consecutive-call.typ new file mode 100644 index 000000000..6c0aacc36 --- /dev/null +++ b/syntaxes/textmate/tests/unit/math/consecutive-call.typ @@ -0,0 +1 @@ +$upright(A)upright(m)$ "Test it." diff --git a/syntaxes/textmate/tests/unit/math/consecutive-call.typ.snap b/syntaxes/textmate/tests/unit/math/consecutive-call.typ.snap new file mode 100644 index 000000000..6b8e435e4 --- /dev/null +++ b/syntaxes/textmate/tests/unit/math/consecutive-call.typ.snap @@ -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 +> \ No newline at end of file