aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2013-08-15 18:20:03 +0300
committerEli Zaretskii2013-08-15 18:20:03 +0300
commitd39a3da6f3df4ff3c08e5b68fe629e10d1b8f3ea (patch)
tree1ead9db11e0da3c8649a422bc23587e47353aefb
parent6e856b69ffea045be4efe029ecbb44df7fd4da21 (diff)
downloademacs-d39a3da6f3df4ff3c08e5b68fe629e10d1b8f3ea.tar.gz
emacs-d39a3da6f3df4ff3c08e5b68fe629e10d1b8f3ea.zip
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.
-rw-r--r--src/ChangeLog9
-rw-r--r--src/xdisp.c20
2 files changed, 28 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 5131f666c6e..1a83531ad10 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,12 @@
12013-08-15 Eli Zaretskii <eliz@gnu.org>
2
3 * xdisp.c (compute_window_start_on_continuation_line): When
4 WORD_WRAP is in effect, use move_it_to instead of move_it_by_lines
5 to make sure we end up setting the window start at the leftmost
6 visible character of the display line. This avoids funky
7 horizontal shifting because the window start is not kept on the
8 same position. (Bug#15090)
9
12013-08-15 Lars Magne Ingebrigtsen <larsi@gnus.org> 102013-08-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
2 11
3 * image.c (imagemagick_compute_animated_image): Implement animated 12 * image.c (imagemagick_compute_animated_image): Implement animated
diff --git a/src/xdisp.c b/src/xdisp.c
index 4d0b0ab9974..8b72c58cd07 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -14912,7 +14912,25 @@ compute_window_start_on_continuation_line (struct window *w)
14912 { 14912 {
14913 min_distance = distance; 14913 min_distance = distance;
14914 pos = it.current.pos; 14914 pos = it.current.pos;
14915 move_it_by_lines (&it, 1); 14915 if (it.line_wrap == WORD_WRAP)
14916 {
14917 /* Under WORD_WRAP, move_it_by_lines is likely to
14918 overshoot and stop not at the first, but the
14919 second character from the left margin. So in
14920 that case, we need a more tight control on the X
14921 coordinate of the iterator than move_it_by_lines
14922 promises in its contract. The method is to first
14923 go to the last (rightmost) visible character of a
14924 line, then move to the leftmost character on the
14925 next line in a separate call. */
14926 move_it_to (&it, ZV, it.last_visible_x, it.current_y, -1,
14927 MOVE_TO_POS | MOVE_TO_X | MOVE_TO_Y);
14928 move_it_to (&it, ZV, 0,
14929 it.current_y + it.max_ascent + it.max_descent, -1,
14930 MOVE_TO_POS | MOVE_TO_X | MOVE_TO_Y);
14931 }
14932 else
14933 move_it_by_lines (&it, 1);
14916 } 14934 }
14917 14935
14918 /* Set the window start there. */ 14936 /* Set the window start there. */