Skip to content

Commit 42d9e77

Browse files
committed
Adds jsFunctionKey to jsObjectKey
As per a user's feature request, this adds a slightly higher specificity for object keys that define a function.
1 parent 159590e commit 42d9e77

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

syntax/javascript.vim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ syntax region jsRegexpString start=+\(\(\(return\|case\)\s\+\)\@<=\|\(\([)\]
9494
syntax match jsNumber /\<-\=\d\+L\=\>\|\<0[xX]\x\+\>/
9595
syntax keyword jsNumber Infinity
9696
syntax match jsFloat /\<-\=\%(\d\+\.\d\+\|\d\+\.\|\.\d\+\)\%([eE][+-]\=\d\+\)\=\>/
97-
syntax match jsObjectKey /\<[a-zA-Z_$][0-9a-zA-Z_$\-]*\(\s*:\)\@=/
97+
syntax match jsObjectKey /\<[a-zA-Z_$][0-9a-zA-Z_$\-]*\(\s*:\)\@=/ contains=jsFunctionKey
98+
syntax match jsFunctionKey /\<[a-zA-Z_$][0-9a-zA-Z_$\-]*\(\s*:\sfunction\)\@=/ contained
9899

99100
"" JavaScript Prototype
100101
syntax keyword jsPrototype prototype

0 commit comments

Comments
 (0)