changeset 31825:62830644b967

(scrolling_window): Compare y-positions of rows equal at the start. Some simplification.
author Gerd Moellmann <gerd@gnu.org>
date Thu, 21 Sep 2000 18:41:36 +0000
parents b3295c7e7a60
children 2c8c52a67b91
files src/dispnew.c
diffstat 1 files changed, 17 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/src/dispnew.c	Thu Sep 21 18:41:21 2000 +0000
+++ b/src/dispnew.c	Thu Sep 21 18:41:36 2000 +0000
@@ -3812,7 +3812,7 @@
       while (row < end && !row->enabled_p)
 	++row;
       
-      /* Try reusing part of the display by inserting/deleting lines.  */
+      /* Try reusing part of the display by copying.  */
       if (row < end && !desired_matrix->no_scrolling_p)
 	{
 	  int rc = scrolling_window (w, header_line_row != NULL);
@@ -4423,20 +4423,23 @@
   struct row_entry *entry;
 
   /* Skip over rows equal at the start.  */
-  i = header_line_p ? 1 : 0;
-  while (i < current_matrix->nrows - 1
-         && MATRIX_ROW_ENABLED_P (current_matrix, i)
-	 && MATRIX_ROW_ENABLED_P (desired_matrix, i)
-	 && MATRIX_ROW_BOTTOM_Y (MATRIX_ROW (desired_matrix, i)) <= yb
-	 && MATRIX_ROW_BOTTOM_Y (MATRIX_ROW (current_matrix, i)) <= yb
-         && row_equal_p (w,
-			 MATRIX_ROW (desired_matrix, i),
-                         MATRIX_ROW (current_matrix, i), 1))
+  for (i = header_line_p ? 1 : 0; i < current_matrix->nrows - 1; ++i)
     {
-      assign_row (MATRIX_ROW (current_matrix, i),
-		  MATRIX_ROW (desired_matrix, i));
-      MATRIX_ROW (desired_matrix, i)->enabled_p = 0;
-      ++i;
+      struct glyph_row *d = MATRIX_ROW (desired_matrix, i);
+      struct glyph_row *c = MATRIX_ROW (current_matrix, i);
+
+      if (c->enabled_p
+	  && d->enabled_p
+	  && c->y == d->y
+	  && MATRIX_ROW_BOTTOM_Y (c) <= yb
+	  && MATRIX_ROW_BOTTOM_Y (d) <= yb
+	  && row_equal_p (w, c, d, 1))
+	{
+	  assign_row (c, d);
+	  d->enabled_p = 0;
+	}
+      else
+	break;
     }
 
   /* Give up if some rows in the desired matrix are not enabled.  */