aboutsummaryrefslogtreecommitdiffstats
path: root/src/syntax.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/syntax.c')
-rw-r--r--src/syntax.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/src/syntax.c b/src/syntax.c
index 68ef32828c4..1b05ed57204 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -130,8 +130,8 @@ update_syntax_table (charpos, count, init, object)
130 invalidate = 0; 130 invalidate = 0;
131 if (NULL_INTERVAL_P (i)) 131 if (NULL_INTERVAL_P (i))
132 return; 132 return;
133 gl_state.b_property = i->position - 1; 133 gl_state.b_property = i->position - 1 - gl_state.offset;
134 gl_state.e_property = INTERVAL_LAST_POS (i); 134 gl_state.e_property = INTERVAL_LAST_POS (i) - gl_state.offset;
135 goto update; 135 goto update;
136 } 136 }
137 oldi = i = count > 0 ? gl_state.forward_i : gl_state.backward_i; 137 oldi = i = count > 0 ? gl_state.forward_i : gl_state.backward_i;
@@ -151,7 +151,7 @@ update_syntax_table (charpos, count, init, object)
151 invalidate = 0; 151 invalidate = 0;
152 gl_state.right_ok = 1; /* Invalidate the other end. */ 152 gl_state.right_ok = 1; /* Invalidate the other end. */
153 gl_state.forward_i = i; 153 gl_state.forward_i = i;
154 gl_state.e_property = INTERVAL_LAST_POS (i); 154 gl_state.e_property = INTERVAL_LAST_POS (i) - gl_state.offset;
155 } 155 }
156 } 156 }
157 else if (charpos >= INTERVAL_LAST_POS (i)) /* Move right. */ 157 else if (charpos >= INTERVAL_LAST_POS (i)) /* Move right. */
@@ -165,7 +165,7 @@ update_syntax_table (charpos, count, init, object)
165 invalidate = 0; 165 invalidate = 0;
166 gl_state.left_ok = 1; /* Invalidate the other end. */ 166 gl_state.left_ok = 1; /* Invalidate the other end. */
167 gl_state.backward_i = i; 167 gl_state.backward_i = i;
168 gl_state.b_property = i->position - 1; 168 gl_state.b_property = i->position - 1 - gl_state.offset;
169 } 169 }
170 } 170 }
171 else if (count > 0 ? gl_state.right_ok : gl_state.left_ok) 171 else if (count > 0 ? gl_state.right_ok : gl_state.left_ok)
@@ -187,13 +187,13 @@ update_syntax_table (charpos, count, init, object)
187 { 187 {
188 gl_state.backward_i = i; 188 gl_state.backward_i = i;
189 gl_state.left_ok = 1; /* Invalidate the other end. */ 189 gl_state.left_ok = 1; /* Invalidate the other end. */
190 gl_state.b_property = i->position - 1; 190 gl_state.b_property = i->position - 1 - gl_state.offset;
191 } 191 }
192 else 192 else
193 { 193 {
194 gl_state.forward_i = i; 194 gl_state.forward_i = i;
195 gl_state.right_ok = 1; /* Invalidate the other end. */ 195 gl_state.right_ok = 1; /* Invalidate the other end. */
196 gl_state.e_property = INTERVAL_LAST_POS (i); 196 gl_state.e_property = INTERVAL_LAST_POS (i) - gl_state.offset;
197 } 197 }
198 } 198 }
199 199
@@ -246,12 +246,12 @@ update_syntax_table (charpos, count, init, object)
246 { 246 {
247 if (count > 0) 247 if (count > 0)
248 { 248 {
249 gl_state.e_property = i->position; 249 gl_state.e_property = i->position - gl_state.offset;
250 gl_state.forward_i = i; 250 gl_state.forward_i = i;
251 } 251 }
252 else 252 else
253 { 253 {
254 gl_state.b_property = i->position + LENGTH (i) - 1; 254 gl_state.b_property = i->position + LENGTH (i) - 1 - gl_state.offset;
255 gl_state.backward_i = i; 255 gl_state.backward_i = i;
256 } 256 }
257 } 257 }
@@ -1370,15 +1370,17 @@ skip_chars (forwardp, syntaxp, string, lim)
1370 { 1370 {
1371 if (multibyte) 1371 if (multibyte)
1372 { 1372 {
1373 while (pos < XINT (lim) 1373 if (pos < XINT (lim))
1374 && fastmap[(int) SYNTAX (FETCH_CHAR (pos_byte))]) 1374 while (fastmap[(int) SYNTAX (FETCH_CHAR (pos_byte))])
1375 { 1375 {
1376 /* Since we already checked for multibyteness, 1376 /* Since we already checked for multibyteness,
1377 avoid using INC_BOTH which checks again. */ 1377 avoid using INC_BOTH which checks again. */
1378 INC_POS (pos_byte); 1378 INC_POS (pos_byte);
1379 pos++; 1379 pos++;
1380 UPDATE_SYNTAX_TABLE_FORWARD (pos); 1380 if (pos >= XINT (lim))
1381 } 1381 break;
1382 UPDATE_SYNTAX_TABLE_FORWARD (pos);
1383 }
1382 } 1384 }
1383 else 1385 else
1384 { 1386 {
@@ -1412,16 +1414,14 @@ skip_chars (forwardp, syntaxp, string, lim)
1412 } 1414 }
1413 else 1415 else
1414 { 1416 {
1415 while (pos > XINT (lim)) 1417 if (pos > XINT (lim))
1416 { 1418 while (fastmap[(int) SYNTAX (FETCH_BYTE (pos - 1))])
1417 pos--; 1419 {
1418 UPDATE_SYNTAX_TABLE_BACKWARD (pos); 1420 pos--;
1419 if (!fastmap[(int) SYNTAX (FETCH_BYTE (pos))]) 1421 if (pos <= XINT (lim))
1420 {
1421 pos++;
1422 break; 1422 break;
1423 } 1423 UPDATE_SYNTAX_TABLE_BACKWARD (pos - 1);
1424 } 1424 }
1425 } 1425 }
1426 } 1426 }
1427 } 1427 }