Commit e29fb7df authored by Eli Zaretskii's avatar Eli Zaretskii

Fix redisplay glitches with RTL composed text

* src/xdisp.c (init_to_row_end): Fail if the first visible
position on the line following ROW is bidi-reordered and could
be composed.  (Bug#35811)
parent e778c38b
Pipeline #1912 failed with stage
in 3 seconds
......@@ -3407,7 +3407,8 @@ init_to_row_start (struct it *it, struct window *w, struct glyph_row *row)
/* Initialize IT for stepping through current_buffer in window W
starting in the line following ROW, i.e. starting at ROW->end.
Value is false if there are overlay strings with newlines at ROW's
end position. */
end position, or if the following row begins with bidi-reordered
characters that could be composed. */
static bool
init_to_row_end (struct it *it, struct window *w, struct glyph_row *row)
......@@ -3420,7 +3421,20 @@ init_to_row_end (struct it *it, struct window *w, struct glyph_row *row)
= row->continuation_lines_width + row->pixel_width;
CHECK_IT (it);
success = true;
/* Initializing IT in the presense of compositions in reordered
rows is tricky: row->end above will generally cause us to
start at position that is not the first one in the logical
order, and we might therefore miss the composition earlier in
the buffer that affects how glypsh are laid out in this row.
So we punt instead. Note: the test below works because
get_next_display_element calls get_visually_first_element,
which calls composition_compute_stop_pos, which populates
it->cmp_it. */
if (get_next_display_element (it)
&& (it->bidi_it.scan_dir == -1 && it-> >= 0))
success = false;
success = true;
return success;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment