From 7ec499c19f91122724d1518887ba3ffe4a8fcb43 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Sun, 27 Sep 2020 12:05:29 +0200 Subject: Set indentation only locally, fixes #564 --- syntax/basic/type.vim | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'syntax/basic') diff --git a/syntax/basic/type.vim b/syntax/basic/type.vim index 616c3271..02e78237 100644 --- a/syntax/basic/type.vim +++ b/syntax/basic/type.vim @@ -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=// -- cgit v1.2.3