Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
fix very slow syntax highlight in runtime/syntax/vim.vim (to be reviewed)
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Dominique Pellé  
View profile   Translate to Translated (View Original)
 More options Aug 16 2012, 3:46 pm
From: Dominique Pellé <dominique.pe...@gmail.com>
Date: Thu, 16 Aug 2012 21:46:21 +0200
Local: Thurs, Aug 16 2012 3:46 pm
Subject: [patch] fix very slow syntax highlight in runtime/syntax/vim.vim (to be reviewed)

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

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bram Moolenaar  
View profile  
 More options Aug 17 2012, 4:24 pm
From: Bram Moolenaar <B...@Moolenaar.net>
Date: Fri, 17 Aug 2012 22:24:13 +0200
Local: Fri, Aug 17 2012 4:24 pm
Subject: Re: [patch] fix very slow syntax highlight in runtime/syntax/vim.vim (to be reviewed)

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 -- B...@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    ///


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »