Skip to content

Commit bf34e60

Browse files
committed
Forcing class text to be a keyword
This class regex will match if the text class is contained within a larger variable name, and therefore is broken.
1 parent 2c70878 commit bf34e60

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

syntax/javascript.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ syntax match jsArrowFuncArgs /([^()]*)\s*\(=>\)\@=/ skipempty skipwhite conta
222222
syntax keyword jsClassKeywords extends class contained
223223
syntax match jsClassNoise /\./ contained
224224
syntax keyword jsClassMethodDefinitions get set static contained nextgroup=jsFuncName skipwhite skipempty
225-
syntax match jsClassDefinition /class\%( [a-zA-Z_$][0-9a-zA-Z_$ \n.]*\)*/ contains=jsClassKeywords,jsClassNoise nextgroup=jsClassBlock skipwhite skipempty
225+
syntax match jsClassDefinition /\<class\>\%( [a-zA-Z_$][0-9a-zA-Z_$ \n.]*\)*/ contains=jsClassKeywords,jsClassNoise nextgroup=jsClassBlock skipwhite skipempty
226226

227227
" Define the default highlighting.
228228
" For version 5.7 and earlier: only when not done already

0 commit comments

Comments
 (0)