Skip to content

Commit bfe2920

Browse files
committed
Improvements to rest highlighting
* Added higher specificity to the dots in the spread declaration
1 parent 152f36e commit bfe2920

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
@@ -219,7 +219,8 @@ syntax match jsGenerator contained '\*' nextgroup=jsFuncName skipwhite
219219
syntax match jsFuncName contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*/ nextgroup=jsFuncArgs skipwhite
220220
syntax region jsFuncArgs contained matchgroup=jsFuncParens start='(' end=')' contains=jsFuncArgCommas,jsFuncArgRest,jsAssignmentExpr,jsComment,jsLineComment nextgroup=jsFuncBlock keepend skipwhite skipempty
221221
syntax match jsFuncArgCommas contained ','
222-
syntax match jsFuncArgRest contained /\%(\.\.\.[a-zA-Z_$][0-9a-zA-Z_$]*\))/
222+
syntax match jsFuncArgRest contained /\%(\.\.\.[a-zA-Z_$][0-9a-zA-Z_$]*\))/ contains=jsFuncArgRestDots
223+
syntax match jsFuncArgRestDots contained /\.\.\./
223224

224225
exe 'syntax match jsArrowFunction /=>/ '.(exists('g:javascript_conceal_arrow_function') ? 'conceal cchar='.g:javascript_conceal_arrow_function : '')
225226

@@ -315,6 +316,7 @@ if version >= 508 || !exists("did_javascript_syn_inits")
315316
HiLink jsModules Include
316317
HiLink jsModuleWords Include
317318
HiLink jsDecorator Special
319+
HiLink jsFuncArgRestDots Noise
318320

319321
HiLink jsDomErrNo Constant
320322
HiLink jsDomNodeConsts Constant

0 commit comments

Comments
 (0)