]>
Commit | Line | Data |
---|---|---|
f3c378e8 AG |
1 | To: vim-dev@vim.org |
2 | Subject: Patch 7.0.117 | |
3 | Fcc: outbox | |
4 | From: Bram Moolenaar <Bram@moolenaar.net> | |
5 | Mime-Version: 1.0 | |
6 | Content-Type: text/plain; charset=ISO-8859-1 | |
7 | Content-Transfer-Encoding: 8bit | |
8 | ------------ | |
9 | ||
10 | Patch 7.0.117 | |
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) | |
17 | Files: src/syntax.c | |
18 | ||
19 | ||
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 | |
22 | *************** | |
23 | *** 977,982 **** | |
24 | --- 977,983 ---- | |
25 | { | |
26 | stateitem_T *cur_si; | |
27 | int i; | |
28 | + int seen_keepend; | |
29 | ||
30 | if (startofline) | |
31 | { | |
32 | *************** | |
33 | *** 1002,1008 **** | |
34 | /* | |
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. | |
39 | */ | |
40 | i = current_state.ga_len - 1; | |
41 | --- 1003,1012 ---- | |
42 | /* | |
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. | |
50 | */ | |
51 | i = current_state.ga_len - 1; | |
52 | *************** | |
53 | *** 1010,1019 **** | |
54 | --- 1014,1026 ---- | |
55 | for ( ; i > keepend_level; --i) | |
56 | if (CUR_STATE(i).si_flags & HL_EXTEND) | |
57 | break; | |
58 | + | |
59 | + seen_keepend = FALSE; | |
60 | for ( ; i < current_state.ga_len; ++i) | |
61 | { | |
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)) | |
66 | { | |
67 | cur_si->si_h_startpos.col = 0; /* start highl. in col 0 */ | |
68 | *************** | |
69 | *** 1021,1026 **** | |
70 | --- 1028,1036 ---- | |
71 | ||
72 | if (!(cur_si->si_flags & HL_MATCHCONT)) | |
73 | update_si_end(cur_si, (int)current_col, !startofline); | |
74 | + | |
75 | + if (!startofline && (cur_si->si_flags & HL_KEEPEND)) | |
76 | + seen_keepend = TRUE; | |
77 | } | |
78 | } | |
79 | check_keepend(); | |
80 | *************** | |
81 | *** 2564,2569 **** | |
82 | --- 2574,2580 ---- | |
83 | { | |
84 | int i; | |
85 | lpos_T maxpos; | |
86 | + lpos_T maxpos_h; | |
87 | stateitem_T *sip; | |
88 | ||
89 | /* | |
90 | *************** | |
91 | *** 2583,2605 **** | |
92 | break; | |
93 | ||
94 | maxpos.lnum = 0; | |
95 | for ( ; i < current_state.ga_len; ++i) | |
96 | { | |
97 | sip = &CUR_STATE(i); | |
98 | if (maxpos.lnum != 0) | |
99 | { | |
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); | |
103 | sip->si_ends = TRUE; | |
104 | } | |
105 | ! if (sip->si_ends | |
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; | |
112 | } | |
113 | } | |
114 | ||
115 | --- 2594,2623 ---- | |
116 | break; | |
117 | ||
118 | maxpos.lnum = 0; | |
119 | + maxpos_h.lnum = 0; | |
120 | for ( ; i < current_state.ga_len; ++i) | |
121 | { | |
122 | sip = &CUR_STATE(i); | |
123 | if (maxpos.lnum != 0) | |
124 | { | |
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); | |
128 | sip->si_ends = TRUE; | |
129 | } | |
130 | ! if (sip->si_ends && (sip->si_flags & HL_KEEPEND)) | |
131 | ! { | |
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; | |
142 | ! } | |
143 | } | |
144 | } | |
145 | ||
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 | |
148 | *************** | |
149 | *** 668,669 **** | |
150 | --- 668,671 ---- | |
151 | { /* Add new patch number below this line */ | |
152 | + /**/ | |
153 | + 117, | |
154 | /**/ | |
155 | ||
156 | -- | |
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) | |
162 | ||
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 /// |