]> git.eshelyaron.com Git - emacs.git/commitdiff
(x_erase_phys_cursor): Don't erase cursor if cursor row
authorKim F. Storm <storm@cua.dk>
Wed, 16 Jan 2002 23:06:10 +0000 (23:06 +0000)
committerKim F. Storm <storm@cua.dk>
Wed, 16 Jan 2002 23:06:10 +0000 (23:06 +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 24df4986e42dee17b32458d5f5f67759b773a9f4..57e508f9f27349f2b4c630e27472c9484530b5c7 100644 (file)
@@ -4,6 +4,8 @@
        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-01-16  Pavel Jan\e,Bm\e(Bk  <Pavel@Janik.cz>
 
        * xterm.c (XTread_socket) [!USE_X_TOOLKIT]: Compute the value of
index 9fe40866edc9ab1408ff277dc0ecf91d227b8196..af83ae53a2a306bf1ac0999112a3836dd83c2922 100644 (file)
@@ -9462,6 +9462,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 may happen if cursor is at top of 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 77860842d5733ac58ec4da5112af5254736ba8f8..a428b4af8a67fe162a8e1dddce5bedde72a1d45d 100644 (file)
@@ -11396,6 +11396,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