# HG changeset patch # User Chong Yidong # Date 1230649388 0 # Node ID 901d646738f948b9cf1d55cfcdd614d91f137927 # Parent 87e66edb874a023dc38bc3f24c6c6d56f0608841 (Fvertical_motion): Don't advance iterator if we have reseated to the desired position. diff -r 87e66edb874a -r 901d646738f9 src/indent.c --- a/src/indent.c Tue Dec 30 14:50:19 2008 +0000 +++ b/src/indent.c Tue Dec 30 15:03:08 2008 +0000 @@ -2063,7 +2063,7 @@ } else { - int it_start, oselective, first_x, it_overshoot_expected; + int it_start, first_x, it_overshoot_expected; SET_TEXT_POS (pt, PT, PT_BYTE); start_display (&it, w, pt); @@ -2093,11 +2093,15 @@ really at some x > 0. */ reseat_at_previous_visible_line_start (&it); it.current_x = it.hpos = 0; - /* Temporarily disable selective display so we don't move too far */ - oselective = it.selective; - it.selective = 0; - move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS); - it.selective = oselective; + if (IT_CHARPOS (it) != PT) + { + int oselective = it.selective; + /* Temporarily disable selective display so we don't move + too far */ + it.selective = 0; + move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS); + it.selective = oselective; + } if (XINT (lines) <= 0) {