Dominique Pelle wrote:
> ":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.
This is a typical example where the NFA regexp code would avoid the
problem. I'm still waiting for someone to pick up the work, which
mainly involves writing tests and only switching to NFA if we know the
regexp will be executed correctly.
--
hundred-and-one symptoms of being an internet addict:
253. You wait for a slow loading web page before going to the toilet.
/// Bram Moolenaar -- Br...@Moolenaar.net --
http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features --
http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language --
http://www.Zimbu.org ///
\\\ help me help AIDS victims --
http://ICCF-Holland.org ///