mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-07-23 04:35:00 +00:00
dev: terminate expression before math blocks (#347)
* docs: minor updates * dev: terminate expression before math blocks
This commit is contained in:
parent
7faf7973ef
commit
00ec24e18f
3 changed files with 24 additions and 1 deletions
|
@ -302,7 +302,7 @@ const enterExpression = (kind: string, seek: RegExp): textmate.Pattern => {
|
|||
return {
|
||||
/// name: 'markup.expr.typst'
|
||||
begin: new RegExp("#" + seek.source),
|
||||
end: /(?<=;)|(?<=[\)\]\}])(?![;\(\[])|(?=[\s\]\}\)]|$)|(;)/,
|
||||
end: /(?<=;)|(?<=[\)\]\}])(?![;\(\[\$])|(?=[\s\}\]\)\$]|$)|(;)/,
|
||||
beginCaptures: {
|
||||
"0": {
|
||||
name: kind,
|
||||
|
|
2
syntaxes/textmate/tests/unit/bugs/tinymist-issue334.typ
Normal file
2
syntaxes/textmate/tests/unit/bugs/tinymist-issue334.typ
Normal file
|
@ -0,0 +1,2 @@
|
|||
#let xxx = n => $#n$
|
||||
#xxx(1)
|
21
syntaxes/textmate/tests/unit/bugs/tinymist-issue334.typ.snap
Normal file
21
syntaxes/textmate/tests/unit/bugs/tinymist-issue334.typ.snap
Normal file
|
@ -0,0 +1,21 @@
|
|||
>#let xxx = n => $#n$
|
||||
#^ source.typst keyword.control.hash.typst
|
||||
# ^^^ source.typst meta.expr.let.typst storage.type.typst
|
||||
# ^ source.typst meta.expr.let.typst
|
||||
# ^^^ source.typst meta.expr.let.typst variable.other.readwrite.typst
|
||||
# ^ source.typst meta.expr.let.typst
|
||||
# ^^ source.typst meta.expr.let.typst keyword.operator.assignment.typst
|
||||
# ^ source.typst meta.expr.let.typst variable.parameter.typst
|
||||
# ^ source.typst meta.expr.let.typst
|
||||
# ^^ source.typst meta.expr.let.typst storage.type.function.arrow.typst
|
||||
# ^ source.typst meta.expr.let.typst
|
||||
# ^ source.typst meta.expr.let.typst markup.math.typst punctuation.definition.string.math.typst
|
||||
# ^ source.typst meta.expr.let.typst markup.math.typst variable.other.readwrite.hash.typst
|
||||
# ^ source.typst meta.expr.let.typst markup.math.typst variable.other.readwrite.typst
|
||||
# ^ source.typst meta.expr.let.typst markup.math.typst punctuation.definition.string.math.typst
|
||||
>#xxx(1)
|
||||
#^ source.typst entity.name.function.hash.typst
|
||||
# ^^^ source.typst meta.expr.call.typst entity.name.function.typst
|
||||
# ^ source.typst meta.expr.call.typst meta.brace.round.typst
|
||||
# ^ source.typst meta.expr.call.typst constant.numeric.integer.typst
|
||||
# ^ source.typst meta.expr.call.typst meta.brace.round.typst
|
Loading…
Add table
Add a link
Reference in a new issue