vim-pandoc-syntax
vim-pandoc-syntax copied to clipboard
Extremely slow on certain files
I noticed while writing up a lab report the other night that vim-pandoc-syntax can slow vim down almost to a crawl on this file for some reason: https://gist.githubusercontent.com/jebaum/bebcb9e09560b4668cba/raw/83d7c1944e927bc19065267e42462a931b4f2a75/report.md
It's not particularly long. The slowness is a lot more noticeable when I have a vertical monitor displaying ~100 lines of the file at once, but it's pretty bad even at around half that size. I have no idea what in particular is causing the slow down.
Hopefully this can be reproduced, not sure if this is something that can be fixed by refining some regex in the syntax file or if it's just a problem with vim's regex engine. I tried setting regexpengine
both to 1 and 2 and noticed no difference between them. I also played with synmaxcol
and syntax sync minlines / maxlines
. Changing minlines and maxlines to very small values (single digits) seemed to make a small improvement, but not much. Setting filetype=tex
fixed performance but obviously that's not an ideal workaround.
It's probably the tables, but I'll test it further.
I had the a similar problem. Opening up the same long buffer (~1000 lines) in two windows, I get severe slowdowns when adding text in insert mode. I ran syntime, and I got the following figures:
`0.900767 7660 0 0.000706 0.000118 pandocSimpleTable %#=2(^.[[:graph:]].\n)@<!(^.[[:graph:]].\n)(-+\s*)+\n\n@!
0.838103 7380 0 0.000638 0.000114 pandocNoLabel ]@1<!(\s{,3}|^)[[^[]]{-}](\s+|$)[[(]@!
0.689868 8349 690 0.000683 0.000083 pandocReferenceLabel !{,1}\@<!^@<![ `