changeset 43787:56636e0f3b9d

(move_it_vertically_backward): At the end of the function, when moving forward by lines, treat terminal frames specially.
author Gerd Moellmann <gerd@gnu.org>
date Fri, 08 Mar 2002 12:28:17 +0000
parents e48a85f46eca
children 1cc1a2ebd350
files src/xdisp.c
diffstat 1 files changed, 18 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/xdisp.c	Fri Mar 08 11:34:25 2002 +0000
+++ b/src/xdisp.c	Fri Mar 08 12:28:17 2002 +0000
@@ -5404,12 +5404,24 @@
       else if (target_y >= it->current_y + line_height
 	       && IT_CHARPOS (*it) < ZV)
 	{
-	  /* Should move forward by at least one line, maybe more.  */
-	  do
-	    {
-	      move_it_by_lines (it, 1, 1);
-	    }
-	  while (target_y >= line_bottom_y (it) && IT_CHARPOS (*it) < ZV);
+	  /* Should move forward by at least one line, maybe more.
+	     
+	     Note: Calling move_it_by_lines can be expensive on
+	     terminal frames, where compute_motion is used (via
+	     vmotion) to do the job, when there are very long lines
+	     and truncate-lines is nil.  That's the reason for
+	     treating terminal frames specially here.  */
+	  
+	  if (!FRAME_WINDOW_P (it->f))
+	    move_it_vertically (it, target_y - (it->current_y + line_height));
+	  else
+	    {
+	      do
+		{
+		  move_it_by_lines (it, 1, 1);
+		}
+	      while (target_y >= line_bottom_y (it) && IT_CHARPOS (*it) < ZV);
+	    }
 
 	  xassert (IT_CHARPOS (*it) >= BEGV);
 	}