Skip to content

Commit 1ade6f0

Browse files
authored
Adding support for nullish operator (pangloss#1165)
1 parent 24c896e commit 1ade6f0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

syntax/javascript.vim

+3-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,9 @@ syntax region jsModuleGroup contained matchgroup=jsModuleBraces s
156156
syntax region jsSpreadExpression contained matchgroup=jsSpreadOperator start=/\.\.\./ end=/[,}\]]\@=/ contains=@jsExpression
157157
syntax region jsRestExpression contained matchgroup=jsRestOperator start=/\.\.\./ end=/[,)]\@=/
158158
syntax region jsTernaryIf matchgroup=jsTernaryIfOperator start=/?:\@!/ end=/\%(:\|}\@=\)/ contains=@jsExpression extend skipwhite skipempty nextgroup=@jsExpression
159-
syntax match jsOperator /?\.\ze\_D/
159+
" These must occur here or they will be override by jsTernaryIf
160+
syntax match jsOperator /?\.\ze\_D/
161+
syntax match jsOperator /??/ skipwhite skipempty nextgroup=@jsExpression
160162

161163
syntax match jsGenerator contained /\*/ skipwhite skipempty nextgroup=jsFuncName,jsFuncArgs,jsFlowFunctionGroup
162164
syntax match jsFuncName contained /\<\K\k*/ skipwhite skipempty nextgroup=jsFuncArgs,jsFlowFunctionGroup

0 commit comments

Comments
 (0)