Fix bug #18778 with slow redisplay of bracketed L2R text with long lines.
commit6a7884caf2a6f4a7fb7faa9ba275163d40f6bd96
authorEli Zaretskii <eliz@gnu.org>
Wed, 22 Oct 2014 16:09:57 +0000 (22 19:09 +0300)
committerEli Zaretskii <eliz@gnu.org>
Wed, 22 Oct 2014 16:09:57 +0000 (22 19:09 +0300)
treed069f3b26e0a621dffb1747bea2b55f13af3ca16
parent36749d80256f49ac10860405b95fe319012c3b91
Fix bug #18778 with slow redisplay of bracketed L2R text with long lines.

 src/bidi.c (bidi_cache_reset_to): New function.
 (bidi_cache_reset): Call it.
 (bidi_init_it, bidi_line_init): Initialize the bracket_pairing_pos
 member to -1.
 (bidi_resolve_explicit): Reset bracket_pairing_pos and
 bracket_enclosed_type only if bracket_pairing_pos's value is not
 ZV.
 (MAX_BPA_STACK): Make sure the value is signed.
 (PUSH_BPA_STACK): If the BPA stack overflows, don't bail out, but
 stop pushing values onto the stack.
 (bidi_find_bracket_pairs): If the bracketed text is only on the
 base embedding level, remove all the states cached by this
 function from the cache, and return zero, so that the brackets in
 this segment of text are processed as normal neutrals.
 (bidi_resolve_brackets): Detect the brackets that are to be
 processed as neutrals, and don't call bidi_find_bracket_pairs on
 them.
src/ChangeLog
src/bidi.c