Hi
":help todo.txt" contains this item:
===
This line hangs Vim, because of syntax HL:
call append(line, "INFO
....12....18....24....30....36....42....48....54....60....66....72....78%$" )
===
It does not really hangs, it's just very very slow. With a shorter string,
you can see it being slow without hanging, but it gets very slow with
long string.
I found that it happens because of the vimFunc regexp in
runtime/syntax/vim.vim which causes a backtracking explosion
with consecutive dots I think.
If I replace ...
\%([a-zA-Z0-9_.]\+\.\)
... into...
\%([a-zA-Z0-9_]\+\.\)
... then syntax highlighting is instantaneous.
See attached patch.
I'm not sure whether there are side effects.
So perhaps there is a better way to fix it.
But patch should at least help to diagnose the issue.
I CC Charles who maintains the vim.vim syntax file for review.
Regards
-- Dominique
|
|
fix-slow-syntax-highlight-vim.vim-7.3.633.patch
1K
Download
|