+2014-10-30 Eli Zaretskii <eliz@gnu.org>
+
+ * bidi.c (bidi_cache_reset_to): Invalidate bidi_cache_last_idx by
+ setting it to -1.
+ (bidi_find_bracket_pairs): Pass to bidi_cache_reset_to a relative
+ index, not an absolute one, as that's what the function expects.
+
2014-10-30 Dmitry Antipov <dmantipov@yandex.ru>
* xfaces.c (Finternal_set_lisp_face_attribute): Don't try to realize
bidi_cache_reset_to (int n)
{
bidi_cache_idx = bidi_cache_start + n;
- bidi_cache_last_idx = n - 1;
+ bidi_cache_last_idx = -1;
}
/* Reset the cache state to the empty state. We only reset the part
bidi_it->bracket_enclosed_type = embedding_type;
/* bidi_cache_last_idx is set to the index of the current
state, because we just called bidi_cache_find above.
- Force the cache to "forget" all the cached states
- starting from the one corresponding to the outermost
- opening bracket, which is what the current state
- describes. */
- bidi_cache_reset_to (bidi_cache_last_idx);
+ That state describes the outermost opening bracket, the
+ one with which we entered this function. Force the cache
+ to "forget" all the cached states starting from that state. */
+ bidi_cache_reset_to (bidi_cache_last_idx - bidi_cache_start);
/* Set up the next_for_neutral member, to help
bidi_resolve_neutral. */
bidi_it->next_for_neutral.type = embedding_type;