From: Eli Zaretskii Date: Thu, 30 Oct 2014 16:51:53 +0000 (+0200) Subject: Minor fix in bidi.c:bidi_cache_reset_to. X-Git-Tag: emacs-25.0.90~2635^2~618 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b6a7474272ce7de5cf0e5e444a0d9221d0493ab6;p=emacs.git Minor fix in bidi.c:bidi_cache_reset_to. src/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. --- diff --git a/src/ChangeLog b/src/ChangeLog index 6e2e55fa570..88445f3aff4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2014-10-30 Eli Zaretskii + + * 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 * xfaces.c (Finternal_set_lisp_face_attribute): Don't try to realize diff --git a/src/bidi.c b/src/bidi.c index ccdcb2f4451..225acd9d655 100644 --- a/src/bidi.c +++ b/src/bidi.c @@ -572,7 +572,7 @@ static void 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 @@ -2629,11 +2629,10 @@ bidi_find_bracket_pairs (struct bidi_it *bidi_it) 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;