aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/syntax.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/syntax.c b/src/syntax.c
index 1b05ed57204..4ac1c8d1b83 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -130,6 +130,21 @@ 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 /* interval_of () updates only ->position of the return value,
134 update the parents manually to speed up update_interval. */
135 while (!NULL_PARENT (i))
136 {
137 if (AM_RIGHT_CHILD (i))
138 i->parent->position = i->position
139 - LEFT_TOTAL_LENGTH (i) + TOTAL_LENGTH (i) /* right end */
140 - TOTAL_LENGTH (i->parent)
141 + LEFT_TOTAL_LENGTH (i->parent);
142 else
143 i->parent->position = i->position - LEFT_TOTAL_LENGTH (i)
144 + TOTAL_LENGTH (i);
145 i = i->parent;
146 }
147 i = gl_state.forward_i;
133 gl_state.b_property = i->position - 1 - gl_state.offset; 148 gl_state.b_property = i->position - 1 - gl_state.offset;
134 gl_state.e_property = INTERVAL_LAST_POS (i) - gl_state.offset; 149 gl_state.e_property = INTERVAL_LAST_POS (i) - gl_state.offset;
135 goto update; 150 goto update;