diff options
author | Eli Zaretskii <eliz@gnu.org> | 2014-10-30 18:51:53 +0200 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2014-10-30 18:51:53 +0200 |
commit | b6a7474272ce7de5cf0e5e444a0d9221d0493ab6 (patch) | |
tree | 043b428e1e3d9b4571f02bd084f8c85ad254714f /src/bidi.c | |
parent | ff73c2c3e2b99c1a759fd876464d36f6dd57a4b0 (diff) | |
download | emacs-b6a7474272ce7de5cf0e5e444a0d9221d0493ab6.tar.gz |
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.
Diffstat (limited to 'src/bidi.c')
-rw-r--r-- | src/bidi.c | 11 |
1 files changed, 5 insertions, 6 deletions
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; |