Skip to content

Commit d0edf85

Browse files
committed
Fix syntax highlighting for function call
```js if (a < b) { } ``` a < b above will be highlighted as a function call misktakenly
1 parent d3833e2 commit d0edf85

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

syntax/javascript.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ syntax match jsYieldAsterisk +\*+ contained skipwhite skipempty nextgroup=@jsE
231231

232232
" Function Call
233233
" Matches: func(), obj.func(), obj.func?.(), obj.func<Array<number | string>>() etc.
234-
syntax match jsFunctionCall +\<\K\k*\>\%(\_s*<\%(\_[^&|]\{-1,}\%([&|]\_[^&|]\{-1,}\)*\)>\)\?\%(\_s*\%(?\.\)\?\_s*(\)\@=+ contains=jsImport,jsSuper,jsBuiltinFunctions,jsFlowGenericCall skipwhite skipempty nextgroup=jsOptionalOperator,jsFunctionCallArgs
234+
syntax match jsFunctionCall +\<\K\k*\>\%(\_s*<\%(\_[^&|)]\{-1,}\%([&|]\_[^&|)]\{-1,}\)*\)>\)\?\%(\_s*\%(?\.\)\?\_s*(\)\@=+ contains=jsImport,jsSuper,jsBuiltinFunctions,jsFlowGenericCall skipwhite skipempty nextgroup=jsOptionalOperator,jsFunctionCallArgs
235235
syntax region jsFunctionCallArgs matchgroup=jsFunctionParens start=+(+ end=+)+ contained contains=@jsExpression,jsComma,jsSpread skipwhite skipempty nextgroup=jsAccessor,jsFunctionCallArgs,jsDot,jsOptionalOperator,@jsOperators
236236

237237
" Loops

0 commit comments

Comments
 (0)