changeset 38489:19cb32759a2a

(update_window): Don't set the cursor at the end of the update if display update has been paused.
author Gerd Moellmann <gerd@gnu.org>
date Thu, 19 Jul 2001 13:16:14 +0000
parents 2a70c922f6ad
children 1518ad710658
files src/dispnew.c
diffstat 1 files changed, 28 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/dispnew.c	Thu Jul 19 13:10:50 2001 +0000
+++ b/src/dispnew.c	Thu Jul 19 13:16:14 2001 +0000
@@ -4053,7 +4053,7 @@
     {
       struct glyph_row *row, *end;
       struct glyph_row *mode_line_row;
-      struct glyph_row *header_line_row = NULL;
+      struct glyph_row *header_line_row;
       int yb, changed_p = 0, mouse_face_overwritten_p = 0, n_updated;
 
       rif->update_window_begin_hook (w);
@@ -4063,8 +4063,14 @@
 	 Adjust y-positions of other rows by the top line height.  */
       row = desired_matrix->rows;
       end = row + desired_matrix->nrows - 1;
+      
       if (row->mode_line_p)
-	header_line_row = row++;
+	{
+	  header_line_row = row;
+	  ++row;
+	}
+      else
+	header_line_row = NULL;
 
       /* Update the mode line, if necessary.  */
       mode_line_row = MATRIX_MODE_LINE_ROW (desired_matrix);
@@ -4085,8 +4091,19 @@
       
       /* Try reusing part of the display by copying.  */
       if (row < end && !desired_matrix->no_scrolling_p)
-	if (scrolling_window (w, header_line_row != NULL) > 0)
-	  force_p = changed_p = 1;
+	{
+	  int rc = scrolling_window (w, header_line_row != NULL);
+	  if (rc < 0)
+	    {
+	      /* All rows were found to be equal.  */
+	      paused_p = 0;
+	      goto set_cursor;
+	    }
+	  else if (rc > 0)
+	    /* We've scrolled the display.  */
+	    force_p = 1;
+	  changed_p = 1;
+	}
 
       /* Update the top mode line after scrolling because a new top
 	 line would otherwise overwrite lines at the top of the window
@@ -4132,6 +4149,8 @@
       /* Was display preempted?  */
       paused_p = row < end;
       
+    set_cursor:
+      
       /* Fix the appearance of overlapping(overlapped rows.  */
       if (!paused_p && !w->pseudo_window_p)
 	{
@@ -4155,8 +4174,11 @@
       strcpy (w->current_matrix->method, w->desired_matrix->method);
 #endif
 
-      /* End of update of window W.  */
-      rif->update_window_end_hook (w, 1, mouse_face_overwritten_p);
+      /* End the update of window W.  Don't set the cursor if we
+         paused updating the display because in this case,
+         set_window_cursor_after_update hasn't been called, and
+         output_cursor doesn't contain the cursor location.  */
+      rif->update_window_end_hook (w, !paused_p, mouse_face_overwritten_p);
     }
   else
     paused_p = 1;