Mirror of the Vim source from https://github.com/vim/vim
Révision | e8450dbf6f031f2727798a7d955e83dda7ba0288 (tree) |
---|---|
l'heure | 2007-08-22 00:29:56 |
Auteur | vimboss |
Commiter | vimboss |
updated for version 7.1-086
@@ -279,7 +279,8 @@ | ||
279 | 279 | */ |
280 | 280 | typedef struct state_item |
281 | 281 | { |
282 | - int si_idx; /* index of syntax pattern */ | |
282 | + int si_idx; /* index of syntax pattern or | |
283 | + KEYWORD_IDX */ | |
283 | 284 | int si_id; /* highlight group ID for keywords */ |
284 | 285 | int si_trans_id; /* idem, transparancy removed */ |
285 | 286 | int si_m_lnum; /* lnum of the match */ |
@@ -837,9 +838,18 @@ | ||
837 | 838 | current_lnum = end_lnum; |
838 | 839 | break; |
839 | 840 | } |
840 | - spp = &(SYN_ITEMS(syn_buf)[cur_si->si_idx]); | |
841 | - found_flags = spp->sp_flags; | |
842 | - found_match_idx = spp->sp_sync_idx; | |
841 | + if (cur_si->si_idx < 0) | |
842 | + { | |
843 | + /* Cannot happen? */ | |
844 | + found_flags = 0; | |
845 | + found_match_idx = KEYWORD_IDX; | |
846 | + } | |
847 | + else | |
848 | + { | |
849 | + spp = &(SYN_ITEMS(syn_buf)[cur_si->si_idx]); | |
850 | + found_flags = spp->sp_flags; | |
851 | + found_match_idx = spp->sp_sync_idx; | |
852 | + } | |
843 | 853 | found_current_lnum = current_lnum; |
844 | 854 | found_current_col = current_col; |
845 | 855 | found_m_endpos = cur_si->si_m_endpos; |
@@ -2533,6 +2543,10 @@ | ||
2533 | 2543 | stateitem_T *sip = &CUR_STATE(idx); |
2534 | 2544 | synpat_T *spp; |
2535 | 2545 | |
2546 | + /* This should not happen... */ | |
2547 | + if (sip->si_idx < 0) | |
2548 | + return; | |
2549 | + | |
2536 | 2550 | spp = &(SYN_ITEMS(syn_buf)[sip->si_idx]); |
2537 | 2551 | if (sip->si_flags & HL_MATCH) |
2538 | 2552 | sip->si_id = spp->sp_syn_match_id; |
@@ -2648,6 +2662,10 @@ | ||
2648 | 2662 | lpos_T end_endpos; |
2649 | 2663 | int end_idx; |
2650 | 2664 | |
2665 | + /* return quickly for a keyword */ | |
2666 | + if (sip->si_idx < 0) | |
2667 | + return; | |
2668 | + | |
2651 | 2669 | /* Don't update when it's already done. Can be a match of an end pattern |
2652 | 2670 | * that started in a previous line. Watch out: can also be a "keepend" |
2653 | 2671 | * from a containing item. */ |
@@ -2760,6 +2778,10 @@ | ||
2760 | 2778 | char_u *line; |
2761 | 2779 | int had_match = FALSE; |
2762 | 2780 | |
2781 | + /* just in case we are invoked for a keyword */ | |
2782 | + if (idx < 0) | |
2783 | + return; | |
2784 | + | |
2763 | 2785 | /* |
2764 | 2786 | * Check for being called with a START pattern. |
2765 | 2787 | * Can happen with a match that continues to the next line, because it |
@@ -667,6 +667,8 @@ | ||
667 | 667 | static int included_patches[] = |
668 | 668 | { /* Add new patch number below this line */ |
669 | 669 | /**/ |
670 | + 86, | |
671 | +/**/ | |
670 | 672 | 85, |
671 | 673 | /**/ |
672 | 674 | 84, |