]> git.eshelyaron.com Git - emacs.git/commitdiff
(x_erase_phys_cursor): Don't erase cursor if cursor row
authorKim F. Storm <storm@cua.dk>
Fri, 1 Feb 2002 21:15:03 +0000 (21:15 +0000)
committerKim F. Storm <storm@cua.dk>
Fri, 1 Feb 2002 21:15:03 +0000 (21:15 +0000)
is invisible.  This can happen if cursor is on top line of a
window, and we switch to a buffer with a header line.

src/ChangeLog
src/w32term.c
src/xterm.c

index abaf23e695172d71f895de6ccc2ed10c19ad22ec..183d10a3700c58c4b505ce82d5589b43d011b74b 100644 (file)
@@ -1,3 +1,11 @@
+2002-02-01  Kim F. Storm  <storm@cua.dk>
+
+       * xterm.c (x_erase_phys_cursor): Don't erase cursor if cursor row
+       is invisible.  This can happen if cursor is on top line of a
+       window, and we switch to a buffer with a header line.
+
+       * w32term.c (x_erase_phys_cursor): ditto.
+
 2002-02-01  Eli Zaretskii  <eliz@is.elta.co.il>
 
        * coding.c (decode_composition_emacs_mule): Give up if NCOMPONENT
index 12704fb8bc15bc006574f30c52d90f0fd5d360b8..c9c38b51cb3d584b202279ee2a6219968c8f933a 100644 (file)
@@ -9383,6 +9383,12 @@ x_erase_phys_cursor (w)
   if (!cursor_row->enabled_p)
     goto mark_cursor_off;
   
+  /* If row is completely invisible, don't attempt to delete a cursor which
+     isn't there.  This can happen if cursor is at top of a window, and
+     we switch to a buffer with a header line in that window.  */
+  if (cursor_row->visible_height <= 0)
+    goto mark_cursor_off;
+  
   /* This can happen when the new row is shorter than the old one.
      In this case, either x_draw_glyphs or clear_end_of_line
      should have cleared the cursor.  Note that we wouldn't be
index bda75c3f38f713889756035d7d76d5673706d142..993d217e03da94b5dd8779331cdb56d64b688786 100644 (file)
@@ -11355,6 +11355,12 @@ x_erase_phys_cursor (w)
   if (!cursor_row->enabled_p)
     goto mark_cursor_off;
   
+  /* If row is completely invisible, don't attempt to delete a cursor which
+     isn't there.  This can happen if cursor is at top of a window, and
+     we switch to a buffer with a header line in that window.  */
+  if (cursor_row->visible_height <= 0)
+    goto mark_cursor_off;
+  
   /* This can happen when the new row is shorter than the old one.
      In this case, either x_draw_glyphs or clear_end_of_line
      should have cleared the cursor.  Note that we wouldn't be