Can someone explain or link to valid explanation information on the syntax highlighting mechanism. In particular I am having having a hard time understanding how rules are applied.
Imagine the following rule
syn match paragraph "^\s*[^\n]*\%(\n[^\n]\+\)\n\n\+"
If the applied to a (UNIX) file with of 100 lines. I would expect the pattern to be applied at most 100 times. In reality it is applied much more times.
I have a Markdown syntax file that correctly detects and supports all Pandoc features (and a couple more). But I am confronted with rules being executed tens of thousands times.
Any ideas ?
syntax match
.syntime
to verify (cf.he syntime
). Multi-line regexes are not the issue here, though I did do some testing to see how they impacted the search -- I also tried changing the regex engine (\%#
). My concern is how a regex is called, and why it is called so many times.