summaryrefslogtreecommitdiff
path: root/src/indent.c
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2008-12-30 15:03:08 +0000
committerChong Yidong <cyd@stupidchicken.com>2008-12-30 15:03:08 +0000
commitffe5f75f9bc10a4b274c9c0407b5d5919b5f3171 (patch)
treee69e99645ee1971c75d490a22aa3e504c434917f /src/indent.c
parent473e060a0cd2535cf331ef8d34437499e44f5c4e (diff)
downloademacs-ffe5f75f9bc10a4b274c9c0407b5d5919b5f3171.tar.gz
(Fvertical_motion): Don't advance iterator if we have reseated to the
desired position.
Diffstat (limited to 'src/indent.c')
-rw-r--r--src/indent.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/indent.c b/src/indent.c
index d30d2dc7293..aea60c3ce48 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -2063,7 +2063,7 @@ whether or not it is currently displayed in some window. */)
}
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 @@ whether or not it is currently displayed in some window. */)
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)
{