Skip to content

Commit c024f95

Browse files
committed
Respect 'very-magic' in 'jsAssignmentExpr' regexp
Summary: This regex was modified in 325c048, where the tokens `\(>\)\@!` were added. This was supposed to be a negative lookahead for a literal `>`. However, this didn't work because the regexp has the `\v` flag, so the regexp actually ended up matching nothing. Closes #333. Test Plan: Install the [gerw/vim-HiLinkTrace][HLT] plugin. Write `let x = 3` in a new JavaScript file. Place the cursor on the `x` and enter `:HLT<CR>`. Before the patch is applied, the `SynStack` and `HltTrace` fields of the message should be blank. Then, apply the patch, relaunch vim, and repeat the `HLT` command; the message should now contain `SynStack: jsAssignmentExpr->...`. [HLT]: https://github.com/gerw/vim-HiLinkTrace
1 parent 70c6210 commit c024f95

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
@@ -110,7 +110,7 @@ syntax match jsFunctionKey /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>\(\s*:\s*function
110110
syntax match jsDecorator "@" display contains=jsDecoratorFunction nextgroup=jsDecoratorFunction skipwhite
111111
syntax match jsDecoratorFunction "[a-zA-Z_][a-zA-Z0-9_.]*" display contained nextgroup=jsFunc skipwhite
112112

113-
syntax match jsAssignmentExpr /\v%([a-zA-Z_$]\k*\.)*[a-zA-Z_$]\k*\s*\=\(>\)\@!/ contains=jsFuncAssignExpr,jsAssignExpIdent,jsPrototype,jsOperator,jsThis,jsNoise,jsArgsObj
113+
syntax match jsAssignmentExpr /\v%([a-zA-Z_$]\k*\.)*[a-zA-Z_$]\k*\s*\=\>@!/ contains=jsFuncAssignExpr,jsAssignExpIdent,jsPrototype,jsOperator,jsThis,jsNoise,jsArgsObj
114114
syntax match jsAssignExpIdent /\v[a-zA-Z_$]\k*\ze%(\s*\=)/ contained
115115
syntax match jsFuncAssignExpr /\v%(%([a-zA-Z_$]\k*\.)*[a-zA-Z_$]\k*\s*\=\s*){-1,}\ze%(function\s*\*?\s*\()/ contains=jsFuncAssignObjChain,jsFuncAssignIdent,jsFunction,jsPrototype,jsOperator,jsThis,jsArgsObj contained
116116
syntax match jsFuncAssignObjChain /\v%([a-zA-Z_$]\k*\.)+/ contains=jsPrototype,jsNoise contained

0 commit comments

Comments
 (0)