Hi Neil,
I think I found the cause of this issue:
http://code.google.com/p/vim/issues/detail?id=239
2014/7/19 Sat 0:29:29 UTC+9 [email protected]:
> Status: New
> Owner: ----
> Labels: Type-Defect Priority-Medium
>
> New issue 239 by [email protected]: Python file with large numbers stalls
> the editor
> http://code.google.com/p/vim/issues/detail?id=239
>
> What steps will reproduce the problem?
>
> 1. Open a new document
> 2. :set filetype=python
> 3. type a huge number (like
7853478453785437895437895347895789534798354879534789534798543789345789543789543789543789543798543789345879543789453789543978453789453897543789453798354789345798345789354789543789534897543879345789345789534789543789534978345789453789534789543789543798543789543789543789534789543789354789574389574389574389574389754398754389574389754389754378954379854378954937854378543785439785437985493785437895437894537895439875438974537895437985437984539785497845389745378954378945387945378954378953497853478945378953489753478954397854378954397854378953489753478954397853489754389778543879354798534798354798354789534)
>
> Notice that vim will get slower and slower the longer the number gets.
>
> Seen on MacVim 7.4.258. No additional python plugin apart from what's built
> in.
>
> --
> You received this message because this project is configured to send all
> issue notifications to this address.
> You may adjust your notification preferences at:
> https://code.google.com/hosting/settings
The slowness is caused by \@<=. Using \zs instead of \@<= seems to fix this.
Please check the attached patch.
Regards,
Ken Takata
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.
# HG changeset patch
# Parent aceade2553bea8c3ba3b65e1cebdc8a43c9fe7fd
diff --git a/runtime/syntax/python.vim b/runtime/syntax/python.vim
--- a/runtime/syntax/python.vim
+++ b/runtime/syntax/python.vim
@@ -160,7 +160,7 @@ if !exists("python_no_number_highlight")
syn match pythonNumber
\ "\<\d\+\.\%([eE][+-]\=\d\+\)\=[jJ]\=\%(\W\|$\)\@="
syn match pythonNumber
- \ "\%(^\|\W\)\@<=\d*\.\d\+\%([eE][+-]\=\d\+\)\=[jJ]\=\>"
+ \ "\%(^\|\W\)\zs\d*\.\d\+\%([eE][+-]\=\d\+\)\=[jJ]\=\>"
endif
" Group the built-ins in the order in the 'Python Library Reference' for