diff options
author | Bram Moolenaar <bram@vim.org> | 2011-06-19 04:54:21 +0200 |
---|---|---|
committer | Bram Moolenaar <bram@vim.org> | 2011-06-19 04:54:21 +0200 |
commit | 05ad74e0b2cadd997d85e50a22532c8057fb8c3a (patch) | |
tree | e054d4afce43269021f1026833f99a3f1d57496f | |
parent | 3d2900fb1096a396c6e746a65918524e20abcebc (diff) | |
download | vim-05ad74e0b2cadd997d85e50a22532c8057fb8c3a.tar.gz |
Problem: On a 64 bit system "syn sync fromstart" is very slow. (Bjorn
Steinbrink)
Solution: Store the state when starting to parse from the first line.
-rw-r--r-- | src/syntax.c | 8 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/syntax.c b/src/syntax.c index a9a2e862..f3cb71ed 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -559,7 +559,13 @@ syntax_start(wp, lnum) if (INVALID_STATE(¤t_state)) { syn_sync(wp, lnum, last_valid); - first_stored = current_lnum + syn_block->b_syn_sync_minlines; + if (current_lnum == 1) + /* First line is always valid, no matter "minlines". */ + first_stored = 1; + else + /* Need to parse "minlines" lines before state can be considered + * valid to store. */ + first_stored = current_lnum + syn_block->b_syn_sync_minlines; } else first_stored = current_lnum; diff --git a/src/version.c b/src/version.c index f169b56a..746a145a 100644 --- a/src/version.c +++ b/src/version.c @@ -710,6 +710,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 226, +/**/ 225, /**/ 224, |