Commit d39a3da6 authored by Eli Zaretskii's avatar Eli Zaretskii

Fix bug #15090 with redisplay under linum-mode and visual-line-mode.

 src/xdisp.c (compute_window_start_on_continuation_line): When
 WORD_WRAP is in effect, use move_it_to instead of move_it_by_lines
 to make sure we end up setting the window start at the leftmost
 visible character of the display line.  This avoids funky
 horizontal shifting because the window start is not kept on the
 same position.
parent 6e856b69
2013-08-15 Eli Zaretskii <eliz@gnu.org>
* xdisp.c (compute_window_start_on_continuation_line): When
WORD_WRAP is in effect, use move_it_to instead of move_it_by_lines
to make sure we end up setting the window start at the leftmost
visible character of the display line. This avoids funky
horizontal shifting because the window start is not kept on the
same position. (Bug#15090)
2013-08-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
* image.c (imagemagick_compute_animated_image): Implement animated
......
......@@ -14912,7 +14912,25 @@ compute_window_start_on_continuation_line (struct window *w)
{
min_distance = distance;
pos = it.current.pos;
move_it_by_lines (&it, 1);
if (it.line_wrap == WORD_WRAP)
{
/* Under WORD_WRAP, move_it_by_lines is likely to
overshoot and stop not at the first, but the
second character from the left margin. So in
that case, we need a more tight control on the X
coordinate of the iterator than move_it_by_lines
promises in its contract. The method is to first
go to the last (rightmost) visible character of a
line, then move to the leftmost character on the
next line in a separate call. */
move_it_to (&it, ZV, it.last_visible_x, it.current_y, -1,
MOVE_TO_POS | MOVE_TO_X | MOVE_TO_Y);
move_it_to (&it, ZV, 0,
it.current_y + it.max_ascent + it.max_descent, -1,
MOVE_TO_POS | MOVE_TO_X | MOVE_TO_Y);
}
else
move_it_by_lines (&it, 1);
}
/* Set the window start there. */
......
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