Skip to content

Commit a90b5f9

Browse files
authored
Merge pull request #20 from yuezk/syntax-improve
Fix syntax like `arr[0] < num` highlight error
2 parents 51b5fd5 + 06e263d commit a90b5f9

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

after/syntax/javascript.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ syntax region jsxTag
4545
" s~~~~e
4646
" A big start regexp borrowed from https://git.io/vDyxc
4747
syntax region jsxRegion
48-
\ start=+\(\((\|{\|}\|\[\|\]\|,\|&&\|||\|?\|:\|=\|=>\|\Wreturn\|^return\|\Wdefault\|^\|>\)\_s*\)\@<=<\_s*\z([_\$a-zA-Z]\(\.\?[\$0-9a-zA-Z]\+\)*\)+
48+
\ start=+\(\((\|{\|}\|\[\|,\|&&\|||\|?\|:\|=\|=>\|\Wreturn\|^return\|\Wdefault\|^\|>\)\_s*\)\@<=<\_s*\z([_\$a-zA-Z]\(\.\?[\$0-9a-zA-Z]\+\)*\)+
4949
\ skip=+<!--\_.\{-}-->+
5050
\ end=+</\_s*\z1>+
5151
\ end=+/>+

sample.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class App extends Component {
1616
var c = a<foo
1717
var d = a<foo
1818
var e = a>c
19+
var bar = arr[1] < foo;
1920

2021
if (a<b && a<d || a>c){
2122
return <a></a>

0 commit comments

Comments
 (0)