changeset 97957:109bd25d3c52

(Fvertical_motion): Don't call move_it_by_lines again if moving by a single line.
author Chong Yidong <cyd@stupidchicken.com>
date Tue, 02 Sep 2008 17:28:59 +0000
parents da48a799510d
children dae412744e36
files src/indent.c
diffstat 1 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/indent.c	Tue Sep 02 17:28:47 2008 +0000
+++ b/src/indent.c	Tue Sep 02 17:28:59 2008 +0000
@@ -2128,15 +2128,21 @@
 		 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);
+		}
 	    }
 	}