]> git.eshelyaron.com Git - emacs.git/commitdiff
Minor fix in bidi.c:bidi_cache_reset_to.
authorEli Zaretskii <eliz@gnu.org>
Thu, 30 Oct 2014 16:51:53 +0000 (18:51 +0200)
committerEli Zaretskii <eliz@gnu.org>
Thu, 30 Oct 2014 16:51:53 +0000 (18:51 +0200)
 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.

src/ChangeLog
src/bidi.c

index 6e2e55fa570f642fc164184f7d2fc2ec3a64ebc1..88445f3aff45b6105f07d5f580f433ef13bdc400 100644 (file)
@@ -1,3 +1,10 @@
+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
index ccdcb2f4451d4b06a8478fabaf0e06c30df0e343..225acd9d6553b609bed3fa4172505f44bdd0f9d0 100644 (file)
@@ -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;