4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: Hang in syntax HL when moving over a ")". (Dominique Pelle)
12 Solution: Avoid storing a syntax state in the wrong position in the list of
17 *** ../vim-7.1.226/src/syntax.c Sat Jan 12 16:45:25 2008
18 --- src/syntax.c Sat Jan 12 16:45:44 2008
21 static int syn_stack_cleanup __ARGS((void));
22 static void syn_stack_free_entry __ARGS((buf_T *buf, synstate_T *p));
23 static synstate_T *syn_stack_find_entry __ARGS((linenr_T lnum));
24 ! static synstate_T *store_current_state __ARGS((synstate_T *sp));
25 static void load_current_state __ARGS((synstate_T *from));
26 static void invalidate_current_state __ARGS((void));
27 static int syn_stack_equal __ARGS((synstate_T *sp));
29 static int syn_stack_cleanup __ARGS((void));
30 static void syn_stack_free_entry __ARGS((buf_T *buf, synstate_T *p));
31 static synstate_T *syn_stack_find_entry __ARGS((linenr_T lnum));
32 ! static synstate_T *store_current_state __ARGS((void));
33 static void load_current_state __ARGS((synstate_T *from));
34 static void invalidate_current_state __ARGS((void));
35 static int syn_stack_equal __ARGS((synstate_T *sp));
39 synstate_T *last_valid = NULL;
40 synstate_T *last_min_valid = NULL;
41 ! synstate_T *sp, *prev;
43 linenr_T first_stored;
47 synstate_T *last_valid = NULL;
48 synstate_T *last_min_valid = NULL;
49 ! synstate_T *sp, *prev = NULL;
51 linenr_T first_stored;
55 if (!current_state_stored)
58 ! (void)store_current_state(NULL);
63 if (!current_state_stored)
66 ! (void)store_current_state();
74 dist = syn_buf->b_ml.ml_line_count / (syn_buf->b_sst_len - Rows) + 1;
75 - prev = syn_stack_find_entry(current_lnum);
76 while (current_lnum < lnum)
82 * equal to the current state. If so, then validate all saved
83 * states that depended on a change before the parsed line. */
85 sp = syn_buf->b_sst_first;
87 ! sp = prev->sst_next;
89 && sp->sst_lnum == current_lnum
90 && syn_stack_equal(sp))
92 * equal to the current state. If so, then validate all saved
93 * states that depended on a change before the parsed line. */
95 + prev = syn_stack_find_entry(current_lnum - 1);
97 sp = syn_buf->b_sst_first;
100 ! while (sp != NULL && sp->sst_lnum < current_lnum)
103 && sp->sst_lnum == current_lnum
104 && syn_stack_equal(sp))
107 else if (prev == NULL
108 || current_lnum == lnum
109 || current_lnum >= prev->sst_lnum + dist)
110 ! prev = store_current_state(prev);
113 /* This can take a long time: break when CTRL-C pressed. The current
115 else if (prev == NULL
116 || current_lnum == lnum
117 || current_lnum >= prev->sst_lnum + dist)
118 ! prev = store_current_state();
121 /* This can take a long time: break when CTRL-C pressed. The current
124 * The current state must be valid for the start of the current_lnum line!
127 ! store_current_state(sp)
128 ! synstate_T *sp; /* at or before where state is to be saved or
137 ! sp = syn_stack_find_entry(current_lnum);
140 * If the current state contains a start or end pattern that continues
142 * The current state must be valid for the start of the current_lnum line!
145 ! store_current_state()
151 ! synstate_T *sp = syn_stack_find_entry(current_lnum);
154 * If the current state contains a start or end pattern that continues
157 * Store the current state in b_sst_array[] for later use.
160 ! (void)store_current_state(NULL);
165 * Store the current state in b_sst_array[] for later use.
168 ! (void)store_current_state();
172 *** ../vim-7.1.226/src/version.c Sun Jan 13 17:11:25 2008
173 --- src/version.c Sun Jan 13 17:37:10 2008
177 { /* Add new patch number below this line */
183 Dreams are free, but there's a small charge for alterations.
185 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
186 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
187 \\\ download, build and distribute -- http://www.A-A-P.org ///
188 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///