]> git.eshelyaron.com Git - emacs.git/commitdiff
(Fvertical_motion): Don't call move_it_by_lines again if moving by a
authorChong Yidong <cyd@stupidchicken.com>
Tue, 2 Sep 2008 17:28:59 +0000 (17:28 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Tue, 2 Sep 2008 17:28:59 +0000 (17:28 +0000)
single line.

src/indent.c

index 7bef4949908d0b5cd0b57c8d40b6a8b8c355a13e..25d41a66f59d98506754ec6c1408161cfbb0461a 100644 (file)
@@ -2128,15 +2128,21 @@ whether or not it is currently displayed in some window.  */)
                 which might span multiple screen lines (e.g., if it's
                 on a multi-line display string).  We want to start
                 from the last line that it occupies.  */
-             it.vpos = 0;
              if (PT < ZV)
                {
                  while (IT_CHARPOS (it) <= PT)
-                   move_it_by_lines (&it, 1, 0);
-                 move_it_by_lines (&it, XINT (lines) - 1, 0);
+                   {
+                     it.vpos = 0;
+                     move_it_by_lines (&it, 1, 0);
+                   }
+                 if (XINT (lines) > 1)
+                   move_it_by_lines (&it, XINT (lines) - 1, 0);
                }
              else
-               move_it_by_lines (&it, XINT (lines), 0);
+               {
+                 it.vpos = 0;
+                 move_it_by_lines (&it, XINT (lines), 0);
+               }
            }
        }