Skip to content

Commit 995183b

Browse files
committed
ES6 Class Fixes
* Added support for . within class definition and mapped to jsClassNoise * Linked jsClassNoise to Noise * Tweaked code/whitespace alignment of the jsClass* section
1 parent fd99d77 commit 995183b

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
@@ -224,8 +224,9 @@ syntax match jsFuncArgRest contained /\%(\.\.\.[a-zA-Z_$][0-9a-zA-Z_$]*\))/
224224
exe 'syntax match jsArrowFunction /=>/ '.(exists('g:javascript_conceal_arrow_function') ? 'conceal cchar='.g:javascript_conceal_arrow_function : '')
225225

226226
syntax keyword jsClassKeywords extends class contained
227+
syntax match jsClassNoise /\./ contained
227228
syntax keyword jsClassMethodDefinitions get set static contained nextgroup=jsFuncName skipwhite skipempty
228-
syntax match jsClassDefinition /class [a-zA-Z_$][0-9a-zA-Z_$ \n]*/ contains=jsClassKeywords nextgroup=jsClassBlock skipwhite skipempty
229+
syntax match jsClassDefinition /class [a-zA-Z_$][0-9a-zA-Z_$ \n.]*/ contains=jsClassKeywords,jsClassNoise nextgroup=jsClassBlock skipwhite skipempty
229230

230231
" Define the default highlighting.
231232
" For version 5.7 and earlier: only when not done already
@@ -304,6 +305,7 @@ if version >= 508 || !exists("did_javascript_syn_inits")
304305
HiLink jsFuncBraces Noise
305306
HiLink jsFuncParens Noise
306307
HiLink jsClassBraces Noise
308+
HiLink jsClassNoise Noise
307309
HiLink jsSpecial Special
308310
HiLink jsTemplateVar Special
309311
HiLink jsGlobalObjects Special

0 commit comments

Comments
 (0)