Skip to content

Commit e8a6f93

Browse files
committed
Adding support for switch blocks
Fixes #505
1 parent 1586f72 commit e8a6f93

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

syntax/javascript.vim

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ syntax keyword jsFinally contained finally skipwhite skipempty nextgro
105105
syntax keyword jsCatch contained catch skipwhite skipempty nextgroup=jsParenCatch
106106
syntax keyword jsException throw
107107
syntax keyword jsAsyncKeyword async await
108+
syntax match jsSwitchColon contained /:/ skipwhite skipempty nextgroup=jsBlock
108109

109110
" Keywords
110111
syntax keyword jsGlobalObjects Array Boolean Date Function Iterator Number Object Symbol Map WeakMap Set RegExp String Proxy Promise Buffer ParallelArray ArrayBuffer DataView Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray JSON Math console document window Intl Collator DateTimeFormat NumberFormat
@@ -139,7 +140,7 @@ syntax region jsClassBlock contained matchgroup=jsClassBraces s
139140
syntax region jsFuncBlock contained matchgroup=jsFuncBraces start=/{/ end=/}/ contains=@jsAll extend fold
140141
syntax region jsBlock contained matchgroup=jsBraces start=/{/ end=/}/ contains=@jsAll extend fold
141142
syntax region jsTryCatchBlock contained matchgroup=jsBraces start=/{/ end=/}/ contains=@jsAll skipwhite skipempty nextgroup=jsCatch,jsFinally extend fold
142-
syntax region jsSwitchBlock contained matchgroup=jsBraces start=/{/ end=/}/ contains=@jsAll,jsLabel extend fold
143+
syntax region jsSwitchBlock contained matchgroup=jsBraces start=/{/ end=/}/ contains=@jsAll,jsLabel,jsSwitchColon extend fold
143144
syntax region jsDestructuringBlock contained matchgroup=jsDestructuringBraces start=/{/ end=/}/ contains=jsDestructuringProperty,jsDestructuringAssignment,jsDestructuringNoise,jsDestructuringPropertyComputed,jsSpreadExpression extend fold
144145
syntax region jsDestructuringArray contained matchgroup=jsDestructuringBraces start=/\[/ end=/\]/ contains=jsDestructuringPropertyValue,jsNoise,jsDestructuringProperty,jsSpreadExpression extend fold
145146
syntax region jsObject matchgroup=jsObjectBraces start=/{/ end=/}/ contains=jsObjectKey,jsObjectKeyString,jsObjectKeyComputed,jsObjectSeparator,jsObjectFuncName,jsObjectGetSet,jsGenerator,jsComment,jsObjectStringKey,jsSpreadExpression extend fold
@@ -296,6 +297,7 @@ if version >= 508 || !exists("did_javascript_syn_inits")
296297
HiLink jsSpreadOperator Operator
297298
HiLink jsRestOperator Operator
298299
HiLink jsRestExpression jsFuncArgs
300+
HiLink jsSwitchColon Noise
299301

300302
HiLink jsDestructuringBraces Noise
301303
HiLink jsDestructuringProperty jsFuncArgs

0 commit comments

Comments
 (0)