4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: Using "extend" on a syntax item inside a region with "keepend", an
12 intermediate item may be truncated.
13 When applying the "keepend" and there is an offset to the end
14 pattern the highlighting of a contained item isn't adjusted.
15 Solution: Use the seen_keepend flag to remember when to apply the "keepend"
16 flag. Adjust the keepend highlighting properly. (Ilya Bobir)
20 *** ../vim-7.0.116/src/syntax.c Thu Apr 27 01:58:59 2006
21 --- src/syntax.c Tue Oct 3 17:00:44 2006
35 * Need to update the end of a start/skip/end that continues from the
36 * previous line. And regions that have "keepend", because they may
37 ! * influence contained items.
38 * Then check for items ending in column 0.
40 i = current_state.ga_len - 1;
43 * Need to update the end of a start/skip/end that continues from the
44 * previous line. And regions that have "keepend", because they may
45 ! * influence contained items. If we've just removed "extend"
46 ! * (startofline == 0) then we should update ends of normal regions
47 ! * contained inside "keepend" because "extend" could have extended
48 ! * these "keepend" regions as well as contained normal regions.
49 * Then check for items ending in column 0.
51 i = current_state.ga_len - 1;
55 for ( ; i > keepend_level; --i)
56 if (CUR_STATE(i).si_flags & HL_EXTEND)
59 + seen_keepend = FALSE;
60 for ( ; i < current_state.ga_len; ++i)
62 cur_si = &CUR_STATE(i);
63 if ((cur_si->si_flags & HL_KEEPEND)
64 + || (seen_keepend && !startofline)
65 || (i == current_state.ga_len - 1 && startofline))
67 cur_si->si_h_startpos.col = 0; /* start highl. in col 0 */
72 if (!(cur_si->si_flags & HL_MATCHCONT))
73 update_si_end(cur_si, (int)current_col, !startofline);
75 + if (!startofline && (cur_si->si_flags & HL_KEEPEND))
76 + seen_keepend = TRUE;
95 for ( ; i < current_state.ga_len; ++i)
100 limit_pos_zero(&sip->si_m_endpos, &maxpos);
101 ! limit_pos_zero(&sip->si_h_endpos, &maxpos);
102 limit_pos_zero(&sip->si_eoe_pos, &maxpos);
106 ! && (sip->si_flags & HL_KEEPEND)
107 ! && (maxpos.lnum == 0
108 || maxpos.lnum > sip->si_m_endpos.lnum
109 || (maxpos.lnum == sip->si_m_endpos.lnum
110 ! && maxpos.col > sip->si_m_endpos.col)))
111 ! maxpos = sip->si_m_endpos;
120 for ( ; i < current_state.ga_len; ++i)
123 if (maxpos.lnum != 0)
125 limit_pos_zero(&sip->si_m_endpos, &maxpos);
126 ! limit_pos_zero(&sip->si_h_endpos, &maxpos_h);
127 limit_pos_zero(&sip->si_eoe_pos, &maxpos);
130 ! if (sip->si_ends && (sip->si_flags & HL_KEEPEND))
132 ! if (maxpos.lnum == 0
133 || maxpos.lnum > sip->si_m_endpos.lnum
134 || (maxpos.lnum == sip->si_m_endpos.lnum
135 ! && maxpos.col > sip->si_m_endpos.col))
136 ! maxpos = sip->si_m_endpos;
137 ! if (maxpos_h.lnum == 0
138 ! || maxpos_h.lnum > sip->si_h_endpos.lnum
139 ! || (maxpos_h.lnum == sip->si_h_endpos.lnum
140 ! && maxpos_h.col > sip->si_h_endpos.col))
141 ! maxpos_h = sip->si_h_endpos;
146 *** ../vim-7.0.116/src/version.c Tue Oct 3 16:30:40 2006
147 --- src/version.c Tue Oct 3 16:59:50 2006
151 { /* Add new patch number below this line */
157 For humans, honesty is a matter of degree. Engineers are always honest in
158 matters of technology and human relationships. That's why it's a good idea
159 to keep engineers away from customers, romantic interests, and other people
160 who can't handle the truth.
161 (Scott Adams - The Dilbert principle)
163 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
164 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
165 \\\ download, build and distribute -- http://www.A-A-P.org ///
166 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///