Skip to content

Commit fc38746

Browse files
committed
Potential fix for jsClassValue region
This fix may actually work out for us when using jsClassValue. There still are some cases where it could be tripped up, for example on multi line equations and stuff, but for the most part I think it should do the trick.
1 parent 5a0ae76 commit fc38746

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

syntax/javascript.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ syntax match jsClassDefinition /\<class\>\%( [a-zA-Z_$][0-9a-zA-Z_$ \n.
163163
syntax match jsDecorator contained "@" nextgroup=jsDecoratorFunction
164164
syntax match jsDecoratorFunction contained "[a-zA-Z_][a-zA-Z0-9_.]*"
165165
syntax match jsClassProperty contained /\<[0-9a-zA-Z_$]*\>\(\s*=\)\@=/ skipwhite skipempty nextgroup=jsClassValue
166-
syntax region jsClassValue contained start=/=/ end=/\%(;\|}\)\@=/ contains=@jsExpression
166+
syntax region jsClassValue contained start=/=/ end=/\%(;\|}\|\n\)\@=/ contains=@jsExpression
167167
syntax region jsClassPropertyComputed contained matchgroup=jsBrackets start=/\[/ end=/]/ contains=@jsExpression skipwhite skipempty nextgroup=jsFuncArgs extend
168168
syntax match jsClassFuncName contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>\%(\s*(\)\@=/ skipwhite skipempty nextgroup=jsFuncArgs
169169

@@ -296,7 +296,7 @@ if version >= 508 || !exists("did_javascript_syn_inits")
296296
HiLink jsFuncArgRestDots Noise
297297
HiLink jsFuncArgDestructuring Noise
298298
HiLink jsModuleAsterisk Noise
299-
HiLink jsClassProperty Identifier
299+
HiLink jsClassProperty jsObjectKey
300300
HiLink jsSpreadOperator Operator
301301

302302
HiLink jsDomErrNo Constant

0 commit comments

Comments
 (0)