Fix bug #9771 with slow redisplay in long lines full of control characters.
authorEli Zaretskii <eliz@gnu.org>
Tue, 18 Oct 2011 16:56:09 +0000 (18:56 +0200)
committerEli Zaretskii <eliz@gnu.org>
Tue, 18 Oct 2011 16:56:09 +0000 (18:56 +0200)
commit4787455fb7e0a33fe5420b4414a3b6e87685e45d
tree8e096ba87813b86f17f498a663e0f0865774b762
parent0a768890bacef10b9eb806982244044c12392dd9
Fix bug #9771 with slow redisplay in long lines full of control characters.

 src/bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
 (bidi_resolve_neutral): Don't enter the expensive loop looking for
 non-neutral characters if the current character is a paragraph
 separator (a.k.a. Newline).  This avoids running the same
 expensive loop twice, once when we consume the preceding newline
 and the other time when the line actually needs to be displayed.
 Avoid the loop when we see neutrals on the base embedding level
 following a character whose directionality is the same as the
 paragraph's.  This avoids running the expensive loop when a line
 ends in a long sequence of neutrals, like control characters.
 Add assertion against STRONG_AL type.  Slightly rearrange code
 that determines the type of a neutral given the first non-neutral
 that follows it.
 (bidi_level_of_next_char): Set next_en_pos to zero when
 invalidating its info.
src/ChangeLog
src/bidi.c