changeset 25493:28588533d342

(try_window_id): Reset first_unchanged_at_end_row if we have displayed to the bottom of the window.
author Gerd Moellmann <gerd@gnu.org>
date Thu, 02 Sep 1999 20:35:56 +0000
parents 863b49f711d6
children 170d491fe703
files src/xdisp.c
diffstat 1 files changed, 13 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/xdisp.c	Thu Sep 02 20:35:55 1999 +0000
+++ b/src/xdisp.c	Thu Sep 02 20:35:56 1999 +0000
@@ -9793,9 +9793,6 @@
       start_pos = it.current.pos;
     }
 
-  bottom_row = MATRIX_BOTTOM_TEXT_ROW (current_matrix, w);
-  bottom_vpos = MATRIX_ROW_VPOS (bottom_row, current_matrix);
-  
   /* Find the first row that is not affected by changes at the end of
      the buffer.  Value will be null if there is no unchanged row, in
      which case we must redisplay to the end of the window.  delta
@@ -9884,7 +9881,10 @@
   /* Compute differences in buffer positions, y-positions etc.  for
      lines reused at the bottom of the window.  Compute what we can
      scroll.  */
-  if (first_unchanged_at_end_row)
+  if (first_unchanged_at_end_row
+      /* No lines reused because we displayed everything up to the
+         bottom of the window.  */
+      && it.current_y < it.last_visible_y)
     {
       dvpos = (it.vpos
 	       - MATRIX_ROW_VPOS (first_unchanged_at_end_row,
@@ -9895,7 +9895,10 @@
       run.height = it.last_visible_y - max (run.current_y, run.desired_y);
     }
   else
-    delta = dvpos = dy = run.current_y = run.desired_y = run.height = 0;
+    {
+      delta = dvpos = dy = run.current_y = run.desired_y = run.height = 0;
+      first_unchanged_at_end_row = NULL;
+    }
   IF_DEBUG (debug_dvpos = dvpos; debug_dy = dy);
 
 
@@ -10043,7 +10046,11 @@
       update_end (f);
     }
 
-  /* Shift reused rows of the current matrix to the right position.  */
+  /* Shift reused rows of the current matrix to the right position.
+     BOTTOM_ROW is the last + 1 row in the current matrix reserved for
+     text.  */
+  bottom_row = MATRIX_BOTTOM_TEXT_ROW (current_matrix, w);
+  bottom_vpos = MATRIX_ROW_VPOS (bottom_row, current_matrix);
   if (dvpos < 0)
     {
       rotate_matrix (current_matrix, first_unchanged_at_end_vpos + dvpos,