mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-07-07 13:05:02 +00:00
fix: stop atom expressions before backslash (#1835)
* fix: stop atom expressions before marks * dev: fix it
This commit is contained in:
parent
96510385a1
commit
4bfb5c22da
3 changed files with 23 additions and 1 deletions
|
@ -691,7 +691,7 @@ const enterExpression = (kind: string, seek: RegExp): textmate.Pattern => {
|
|||
),
|
||||
),
|
||||
// The hash starts a string or an identifier.
|
||||
/(?<!#)(?=["\_\{])/,
|
||||
/(?<!#)(?=["\\\_\{])/,
|
||||
/(?<![#\]\}\]])(?=\[)/,
|
||||
// This means that we are on a dot and the next character is not a valid identifier start, but we are not at the beginning of hash or number
|
||||
/(?=\.(?:[^0-9\p{XID_Start}_]|$))/u,
|
||||
|
|
2
syntaxes/textmate/tests/unit/bugs/tinymist-issue1702.typ
Normal file
2
syntaxes/textmate/tests/unit/bugs/tinymist-issue1702.typ
Normal file
|
@ -0,0 +1,2 @@
|
|||
#let quote(x) = $\"#x\"$
|
||||
Rest of code here...
|
|
@ -0,0 +1,20 @@
|
|||
>#let quote(x) = $\"#x\"$
|
||||
#^ 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 entity.name.function.typst
|
||||
# ^ source.typst meta.expr.let.typst meta.brace.round.typst
|
||||
# ^ source.typst meta.expr.let.typst variable.other.readwrite.typst
|
||||
# ^ source.typst meta.expr.let.typst meta.brace.round.typst
|
||||
# ^ source.typst meta.expr.let.typst
|
||||
# ^^ source.typst meta.expr.let.typst keyword.operator.assignment.typst
|
||||
# ^ source.typst meta.expr.let.typst markup.math.typst punctuation.definition.string.begin.math.typst
|
||||
# ^^ source.typst meta.expr.let.typst markup.math.typst constant.character.escape.content.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 constant.character.escape.content.typst
|
||||
# ^ source.typst meta.expr.let.typst markup.math.typst punctuation.definition.string.end.math.typst
|
||||
>Rest of code here...
|
||||
#^^^^^^^^^^^^^^^^^ source.typst
|
||||
# ^^^ source.typst punctuation.definition.ellipsis.typst
|
||||
>
|
Loading…
Add table
Add a link
Reference in a new issue