Skip to content

Commit 4e2e377

Browse files
committed
Add highlight group specifically for object colons
1 parent 0b6aad4 commit 4e2e377

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

syntax/javascript.vim

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,12 @@ endif
7575
syntax cluster jsRegexpSpecial contains=jsSpecial,jsRegexpBoundary,jsRegexpBackRef,jsRegexpQuantifier,jsRegexpOr,jsRegexpMod
7676

7777
syntax match jsObjectKey contained /\<[0-9a-zA-Z_$]*\>\(\s*:\)\@=/ contains=jsFunctionKey skipwhite skipempty nextgroup=jsObjectValue
78+
syntax match jsObjectColon contained /:/ skipwhite skipempty
7879
syntax region jsObjectKeyString contained start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contains=jsSpecial,@Spell skipwhite skipempty nextgroup=jsObjectValue
7980
syntax region jsObjectKeyString contained start=+'+ skip=+\\\('\|$\)+ end=+'\|$+ contains=jsSpecial,@Spell skipwhite skipempty nextgroup=jsObjectValue
8081
syntax region jsObjectKeyComputed contained matchgroup=jsBrackets start=/\[/ end=/]/ contains=@jsExpression skipwhite skipempty nextgroup=jsObjectValue,jsFuncArgs extend
8182
syntax match jsObjectSeparator contained /,/
82-
syntax region jsObjectValue contained start=/:/ end=/\%(,\|}\)\@=/ contains=@jsExpression extend
83+
syntax region jsObjectValue contained start=/:/ end=/\%(,\|}\)\@=/ contains=jsObjectColon,@jsExpression extend
8384
syntax match jsObjectFuncName contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>[\r\n\t ]*(\@=/ skipwhite skipempty nextgroup=jsFuncArgs
8485
syntax match jsFunctionKey contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>\(\s*:\s*function\s*\)\@=/
8586
syntax match jsObjectMethodType contained /\%(get\|set\|static\|async\)\%( \k\+\)\@=/ skipwhite skipempty nextgroup=jsObjectFuncName
@@ -285,6 +286,7 @@ if version >= 508 || !exists("did_javascript_syn_inits")
285286
HiLink jsFloat Float
286287
HiLink jsBooleanTrue Boolean
287288
HiLink jsBooleanFalse Boolean
289+
HiLink jsObjectColon jsNoise
288290
HiLink jsNoise Noise
289291
HiLink jsBrackets Noise
290292
HiLink jsParens Noise

0 commit comments

Comments
 (0)