mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-28 08:11:05 -08:00
(update_syntax_table): Properly update `position' field of used intervals.
This commit is contained in:
parent
2509b14d79
commit
d80f4cc71c
1 changed files with 15 additions and 0 deletions
15
src/syntax.c
15
src/syntax.c
|
|
@ -130,6 +130,21 @@ update_syntax_table (charpos, count, init, object)
|
|||
invalidate = 0;
|
||||
if (NULL_INTERVAL_P (i))
|
||||
return;
|
||||
/* interval_of () updates only ->position of the return value,
|
||||
update the parents manually to speed up update_interval. */
|
||||
while (!NULL_PARENT (i))
|
||||
{
|
||||
if (AM_RIGHT_CHILD (i))
|
||||
i->parent->position = i->position
|
||||
- LEFT_TOTAL_LENGTH (i) + TOTAL_LENGTH (i) /* right end */
|
||||
- TOTAL_LENGTH (i->parent)
|
||||
+ LEFT_TOTAL_LENGTH (i->parent);
|
||||
else
|
||||
i->parent->position = i->position - LEFT_TOTAL_LENGTH (i)
|
||||
+ TOTAL_LENGTH (i);
|
||||
i = i->parent;
|
||||
}
|
||||
i = gl_state.forward_i;
|
||||
gl_state.b_property = i->position - 1 - gl_state.offset;
|
||||
gl_state.e_property = INTERVAL_LAST_POS (i) - gl_state.offset;
|
||||
goto update;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue