Closed platosha closed 7 years ago
I don't see any performance issue on my machine. And this line is for attribute, I don't think it will effect when your code only have html tag. Did you try remove this line, then reopen Vim to see the performance change?
@othree I tried commenting the line, and this resolved the performance issue.
Slow file example: https://github.com/vaadin/vaadin-grid/blob/091c567a26bb7ebcf708f3475cc048edd9fb4294/demo/data.html
Steps to reproduce:
:e demo/data.html
:syntime on
:syntime report
TOTAL COUNT MATCH SLOWEST AVERAGE NAME PATTERN
38.189497 162 0 3.883480 0.235738 htmlArg \<\(x\-\([a-z_][a-z0-9_.\-]*\)\+\)\{2,}\>
0.001624 267 20 0.000032 0.000006 htmlTagName \<\(b\|i\|u\|h[1-6]\|em\|strong\|head\|body\|title
0.001348 374 124 0.000014 0.000004 htmlTagError [^>]<
0.001287 168 91 0.000037 0.000008 jsFuncCall \k\+\%(\s*(\)\@=
0.001188 98 0 0.000040 0.000012 jsArrowFuncArgs \k\+\s*\%(=>\)\@=
0.001152 257 132 0.000021 0.000004 htmlTagName
...
Could you try the new patterns:
" Custom Data Attributes
" http://w3c.github.io/html/single-page.html#embedding-custom-non-visible-data-with-the-data-attributes
syn match htmlArg "\<data[-.0-9_a-z]*-[-.0-9_a-z]*\>" contained
" Vendor Extension Attributes
" http://w3c.github.io/html/single-page.html#conformance-requirements-extensibility
syn match htmlArg "\<x[-.0-9_a-z]*-[-.0-9_a-z]*\>" contained
I tested and have huge improve.
It’s much better now! Thanks a lot for fixing this quickly.
Having custom elements named like
<x-my-custom-element></x-my-custom-element>
makes editor unusably slow.