2011-07-02 Eli Zaretskii <eliz@gnu.org>
+ * xdisp.c (reseat_1): Call bidi_init_it to resync the bidi
+ iterator with IT's position.
+ (handle_stop, back_to_previous_visible_line_start, reseat_1):
+ Reset the from_disp_prop_p flag.
+
+ * bidi.c (bidi_cache_search): Don't assume bidi_cache_last_idx is
+ always valid if bidi_cache_idx is valid.
+ (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
+ is valid if it's going to be used.
+
* dispextern.h (struct iterator_stack_entry, struct it): New
member from_disp_prop_p.
{
int i, i_start;
- if (bidi_cache_idx)
+ if (bidi_cache_idx > bidi_cache_start)
{
+ if (bidi_cache_last_idx == -1)
+ bidi_cache_last_idx = bidi_cache_idx - 1;
if (charpos < bidi_cache[bidi_cache_last_idx].charpos)
{
dir = -1;
int i = dir ? bidi_cache_last_idx : bidi_cache_idx - 1;
int incr = before ? 1 : 0;
+ xassert (!dir || bidi_cache_last_idx >= 0);
+
if (!dir)
dir = -1;
else if (!incr)
{
it->ignore_overlay_strings_at_pos_p = 1;
it->string_from_display_prop_p = 0;
+ it->from_disp_prop_p = 0;
handle_overlay_change_p = 0;
}
handled = HANDLED_RECOMPUTE_PROPS;
--IT_BYTEPOS (it2);
it2.sp = 0;
it2.string_from_display_prop_p = 0;
+ it2.from_disp_prop_p = 0;
if (handle_display_prop (&it2) == HANDLED_RETURN
&& !NILP (val = get_char_property_and_overlay
(make_number (pos), Qdisplay, Qnil, &overlay))
it->multibyte_p = !NILP (BVAR (current_buffer, enable_multibyte_characters));
it->sp = 0;
it->string_from_display_prop_p = 0;
+ it->from_disp_prop_p = 0;
it->face_before_selective_p = 0;
if (it->bidi_p)
{
- it->bidi_it.first_elt = 1;
+ bidi_init_it (IT_CHARPOS (*it), IT_BYTEPOS (*it), FRAME_WINDOW_P (it->f),
+ &it->bidi_it);
it->bidi_it.paragraph_dir = NEUTRAL_DIR;
- it->bidi_it.disp_pos = -1;
it->bidi_it.string.s = NULL;
it->bidi_it.string.lstring = Qnil;
it->bidi_it.string.bufpos = 0;