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 +++++++++++++++- syntax/common.vim | 1 + syntax/elixir.vim | 6 +----- 3 files changed, 17 insertions(+), 6 deletions(-) (limited to 'syntax') 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=// diff --git a/syntax/common.vim b/syntax/common.vim index 0fca4de1..b5e5c16c 100644 --- a/syntax/common.vim +++ b/syntax/common.vim @@ -71,6 +71,7 @@ if exists("did_typescript_hilink") HiLink typescriptString String HiLink typescriptSpecial Special HiLink typescriptStringLiteralType String + HiLink typescriptTemplateLiteralType String HiLink typescriptStringMember String HiLink typescriptTemplate String HiLink typescriptEventString String diff --git a/syntax/elixir.vim b/syntax/elixir.vim index ca057b3d..890bb279 100644 --- a/syntax/elixir.vim +++ b/syntax/elixir.vim @@ -20,10 +20,6 @@ syn keyword elixirTodo FIXME NOTE TODO OPTIMIZE XXX HACK contained syn match elixirId '\<[_a-zA-Z]\w*[!?]\?\>' contains=elixirUnusedVariable -syn match elixirFunctionCall '\<[a-z_]\w*[!?]\?\(\s*\.\?\s*(\|\s\+[a-zA-Z0-9@:\'\"\[]\)\@=' -syn match elixirFunctionCall '\(:\w\+\s*\.\s*\|[A-Z]\w*\s*\.\s*\)\@<=[a-z_]\w*[!?]\?' -syn match elixirFunctionCall '\(>\s+\)\<[a-z_]\w*[!?]\?' - syn match elixirKeyword '\(\.\)\@:\@!' syn keyword elixirInclude import require alias use @@ -48,7 +44,7 @@ syn match elixirOperator '\~>\|\~>>\|<\~\|<<\~\|<\~>' syn match elixirAlias '\([a-z]\)\@=]\@!\)\?\|<>\|===\?\|>=\?\|<=\?\)' +syn match elixirAtom '\(:\)\@=]\@!\)\?\|<>\|===\?\|>=\?\|<=\?\)' syn match elixirAtom '\(:\)\@\|&&\?\|%\(()\|\[\]\|{}\)\|++\?\|--\?\|||\?\|!\|//\|[%&`/|]\)' syn match elixirAtom "\%([a-zA-Z_]\w*[?!]\?\):\(:\)\@!" -- cgit v1.2.3