mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
updated for version 7.1-227
This commit is contained in:
25
src/syntax.c
25
src/syntax.c
@@ -372,7 +372,7 @@ static void syn_stack_alloc __ARGS((void));
|
|||||||
static int syn_stack_cleanup __ARGS((void));
|
static int syn_stack_cleanup __ARGS((void));
|
||||||
static void syn_stack_free_entry __ARGS((buf_T *buf, synstate_T *p));
|
static void syn_stack_free_entry __ARGS((buf_T *buf, synstate_T *p));
|
||||||
static synstate_T *syn_stack_find_entry __ARGS((linenr_T lnum));
|
static synstate_T *syn_stack_find_entry __ARGS((linenr_T lnum));
|
||||||
static synstate_T *store_current_state __ARGS((synstate_T *sp));
|
static synstate_T *store_current_state __ARGS((void));
|
||||||
static void load_current_state __ARGS((synstate_T *from));
|
static void load_current_state __ARGS((synstate_T *from));
|
||||||
static void invalidate_current_state __ARGS((void));
|
static void invalidate_current_state __ARGS((void));
|
||||||
static int syn_stack_equal __ARGS((synstate_T *sp));
|
static int syn_stack_equal __ARGS((synstate_T *sp));
|
||||||
@@ -464,7 +464,7 @@ syntax_start(wp, lnum)
|
|||||||
synstate_T *p;
|
synstate_T *p;
|
||||||
synstate_T *last_valid = NULL;
|
synstate_T *last_valid = NULL;
|
||||||
synstate_T *last_min_valid = NULL;
|
synstate_T *last_min_valid = NULL;
|
||||||
synstate_T *sp, *prev;
|
synstate_T *sp, *prev = NULL;
|
||||||
linenr_T parsed_lnum;
|
linenr_T parsed_lnum;
|
||||||
linenr_T first_stored;
|
linenr_T first_stored;
|
||||||
int dist;
|
int dist;
|
||||||
@@ -502,7 +502,7 @@ syntax_start(wp, lnum)
|
|||||||
if (!current_state_stored)
|
if (!current_state_stored)
|
||||||
{
|
{
|
||||||
++current_lnum;
|
++current_lnum;
|
||||||
(void)store_current_state(NULL);
|
(void)store_current_state();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -558,7 +558,6 @@ syntax_start(wp, lnum)
|
|||||||
dist = 999999;
|
dist = 999999;
|
||||||
else
|
else
|
||||||
dist = syn_buf->b_ml.ml_line_count / (syn_buf->b_sst_len - Rows) + 1;
|
dist = syn_buf->b_ml.ml_line_count / (syn_buf->b_sst_len - Rows) + 1;
|
||||||
prev = syn_stack_find_entry(current_lnum);
|
|
||||||
while (current_lnum < lnum)
|
while (current_lnum < lnum)
|
||||||
{
|
{
|
||||||
syn_start_line();
|
syn_start_line();
|
||||||
@@ -572,10 +571,14 @@ syntax_start(wp, lnum)
|
|||||||
/* Check if the saved state entry is for the current line and is
|
/* Check if the saved state entry is for the current line and is
|
||||||
* equal to the current state. If so, then validate all saved
|
* equal to the current state. If so, then validate all saved
|
||||||
* states that depended on a change before the parsed line. */
|
* states that depended on a change before the parsed line. */
|
||||||
|
if (prev == NULL)
|
||||||
|
prev = syn_stack_find_entry(current_lnum - 1);
|
||||||
if (prev == NULL)
|
if (prev == NULL)
|
||||||
sp = syn_buf->b_sst_first;
|
sp = syn_buf->b_sst_first;
|
||||||
else
|
else
|
||||||
sp = prev->sst_next;
|
sp = prev;
|
||||||
|
while (sp != NULL && sp->sst_lnum < current_lnum)
|
||||||
|
sp = sp->sst_next;
|
||||||
if (sp != NULL
|
if (sp != NULL
|
||||||
&& sp->sst_lnum == current_lnum
|
&& sp->sst_lnum == current_lnum
|
||||||
&& syn_stack_equal(sp))
|
&& syn_stack_equal(sp))
|
||||||
@@ -601,7 +604,7 @@ syntax_start(wp, lnum)
|
|||||||
else if (prev == NULL
|
else if (prev == NULL
|
||||||
|| current_lnum == lnum
|
|| current_lnum == lnum
|
||||||
|| current_lnum >= prev->sst_lnum + dist)
|
|| current_lnum >= prev->sst_lnum + dist)
|
||||||
prev = store_current_state(prev);
|
prev = store_current_state();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This can take a long time: break when CTRL-C pressed. The current
|
/* This can take a long time: break when CTRL-C pressed. The current
|
||||||
@@ -1353,17 +1356,13 @@ syn_stack_find_entry(lnum)
|
|||||||
* The current state must be valid for the start of the current_lnum line!
|
* The current state must be valid for the start of the current_lnum line!
|
||||||
*/
|
*/
|
||||||
static synstate_T *
|
static synstate_T *
|
||||||
store_current_state(sp)
|
store_current_state()
|
||||||
synstate_T *sp; /* at or before where state is to be saved or
|
|
||||||
NULL */
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
synstate_T *p;
|
synstate_T *p;
|
||||||
bufstate_T *bp;
|
bufstate_T *bp;
|
||||||
stateitem_T *cur_si;
|
stateitem_T *cur_si;
|
||||||
|
synstate_T *sp = syn_stack_find_entry(current_lnum);
|
||||||
if (sp == NULL)
|
|
||||||
sp = syn_stack_find_entry(current_lnum);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the current state contains a start or end pattern that continues
|
* If the current state contains a start or end pattern that continues
|
||||||
@@ -1667,7 +1666,7 @@ syntax_check_changed(lnum)
|
|||||||
* Store the current state in b_sst_array[] for later use.
|
* Store the current state in b_sst_array[] for later use.
|
||||||
*/
|
*/
|
||||||
++current_lnum;
|
++current_lnum;
|
||||||
(void)store_current_state(NULL);
|
(void)store_current_state();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -666,6 +666,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
227,
|
||||||
/**/
|
/**/
|
||||||
226,
|
226,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user