Mirror of the Vim source from https://github.com/vim/vim
Revisão | aa7c51f81f46cc5379386ac622a5ba44aae1c4dc (tree) |
---|---|
Hora | 2008-01-14 01:40:19 |
Autor | vimboss |
Commiter | vimboss |
updated for version 7.1-227
@@ -372,7 +372,7 @@ | ||
372 | 372 | static int syn_stack_cleanup __ARGS((void)); |
373 | 373 | static void syn_stack_free_entry __ARGS((buf_T *buf, synstate_T *p)); |
374 | 374 | static synstate_T *syn_stack_find_entry __ARGS((linenr_T lnum)); |
375 | -static synstate_T *store_current_state __ARGS((synstate_T *sp)); | |
375 | +static synstate_T *store_current_state __ARGS((void)); | |
376 | 376 | static void load_current_state __ARGS((synstate_T *from)); |
377 | 377 | static void invalidate_current_state __ARGS((void)); |
378 | 378 | static int syn_stack_equal __ARGS((synstate_T *sp)); |
@@ -464,7 +464,7 @@ | ||
464 | 464 | synstate_T *p; |
465 | 465 | synstate_T *last_valid = NULL; |
466 | 466 | synstate_T *last_min_valid = NULL; |
467 | - synstate_T *sp, *prev; | |
467 | + synstate_T *sp, *prev = NULL; | |
468 | 468 | linenr_T parsed_lnum; |
469 | 469 | linenr_T first_stored; |
470 | 470 | int dist; |
@@ -502,7 +502,7 @@ | ||
502 | 502 | if (!current_state_stored) |
503 | 503 | { |
504 | 504 | ++current_lnum; |
505 | - (void)store_current_state(NULL); | |
505 | + (void)store_current_state(); | |
506 | 506 | } |
507 | 507 | |
508 | 508 | /* |
@@ -558,7 +558,6 @@ | ||
558 | 558 | dist = 999999; |
559 | 559 | else |
560 | 560 | dist = syn_buf->b_ml.ml_line_count / (syn_buf->b_sst_len - Rows) + 1; |
561 | - prev = syn_stack_find_entry(current_lnum); | |
562 | 561 | while (current_lnum < lnum) |
563 | 562 | { |
564 | 563 | syn_start_line(); |
@@ -573,9 +572,13 @@ | ||
573 | 572 | * equal to the current state. If so, then validate all saved |
574 | 573 | * states that depended on a change before the parsed line. */ |
575 | 574 | if (prev == NULL) |
575 | + prev = syn_stack_find_entry(current_lnum - 1); | |
576 | + if (prev == NULL) | |
576 | 577 | sp = syn_buf->b_sst_first; |
577 | 578 | else |
578 | - sp = prev->sst_next; | |
579 | + sp = prev; | |
580 | + while (sp != NULL && sp->sst_lnum < current_lnum) | |
581 | + sp = sp->sst_next; | |
579 | 582 | if (sp != NULL |
580 | 583 | && sp->sst_lnum == current_lnum |
581 | 584 | && syn_stack_equal(sp)) |
@@ -601,7 +604,7 @@ | ||
601 | 604 | else if (prev == NULL |
602 | 605 | || current_lnum == lnum |
603 | 606 | || current_lnum >= prev->sst_lnum + dist) |
604 | - prev = store_current_state(prev); | |
607 | + prev = store_current_state(); | |
605 | 608 | } |
606 | 609 | |
607 | 610 | /* This can take a long time: break when CTRL-C pressed. The current |
@@ -1353,17 +1356,13 @@ | ||
1353 | 1356 | * The current state must be valid for the start of the current_lnum line! |
1354 | 1357 | */ |
1355 | 1358 | static synstate_T * |
1356 | -store_current_state(sp) | |
1357 | - synstate_T *sp; /* at or before where state is to be saved or | |
1358 | - NULL */ | |
1359 | +store_current_state() | |
1359 | 1360 | { |
1360 | 1361 | int i; |
1361 | 1362 | synstate_T *p; |
1362 | 1363 | bufstate_T *bp; |
1363 | 1364 | stateitem_T *cur_si; |
1364 | - | |
1365 | - if (sp == NULL) | |
1366 | - sp = syn_stack_find_entry(current_lnum); | |
1365 | + synstate_T *sp = syn_stack_find_entry(current_lnum); | |
1367 | 1366 | |
1368 | 1367 | /* |
1369 | 1368 | * If the current state contains a start or end pattern that continues |
@@ -1667,7 +1666,7 @@ | ||
1667 | 1666 | * Store the current state in b_sst_array[] for later use. |
1668 | 1667 | */ |
1669 | 1668 | ++current_lnum; |
1670 | - (void)store_current_state(NULL); | |
1669 | + (void)store_current_state(); | |
1671 | 1670 | } |
1672 | 1671 | } |
1673 | 1672 |
@@ -667,6 +667,8 @@ | ||
667 | 667 | static int included_patches[] = |
668 | 668 | { /* Add new patch number below this line */ |
669 | 669 | /**/ |
670 | + 227, | |
671 | +/**/ | |
670 | 672 | 226, |
671 | 673 | /**/ |
672 | 674 | 225, |