Set indentation only locally, fixes #564

This commit is contained in:
Adam Stankiewicz
2020-09-27 12:05:29 +02:00
parent 33b86476b6
commit 7ec499c19f
7 changed files with 36 additions and 15 deletions

View File

@@ -56,6 +56,7 @@ syntax cluster typescriptPrimaryType contains=
\ typescriptTupleType,
\ typescriptTypeQuery,
\ typescriptStringLiteralType,
\ typescriptTemplateLiteralType,
\ typescriptReadonlyArrayKeyword,
\ typescriptAssertType
@@ -64,6 +65,17 @@ syntax region typescriptStringLiteralType contained
\ nextgroup=typescriptUnion
\ skipwhite skipempty
syntax region typescriptTemplateLiteralType contained
\ start=/`/ skip=/\\\\\|\\`\|\n/ end=/`\|$/
\ contains=typescriptTemplateSubstitutionType
\ nextgroup=typescriptTypeOperator
\ skipwhite skipempty
syntax region typescriptTemplateSubstitutionType matchgroup=typescriptTemplateSB
\ start=/\${/ end=/}/
\ contains=@typescriptType
\ contained
syntax region typescriptParenthesizedType matchgroup=typescriptParens
\ start=/(/ end=/)/
\ contains=@typescriptType
@@ -103,10 +115,12 @@ syntax region typescriptTupleType matchgroup=typescriptBraces
\ contained skipwhite
syntax cluster typescriptTypeOperator
\ contains=typescriptUnion,typescriptTypeBracket
\ contains=typescriptUnion,typescriptTypeBracket,typescriptConstraint,typescriptConditionalType
syntax match typescriptUnion /|\|&/ contained nextgroup=@typescriptPrimaryType skipwhite skipempty
syntax match typescriptConditionalType /?\|:/ contained nextgroup=@typescriptPrimaryType skipwhite skipempty
syntax cluster typescriptFunctionType contains=typescriptGenericFunc,typescriptFuncType
syntax region typescriptGenericFunc matchgroup=typescriptTypeBrackets
\ start=/</ end=/>/