# HG changeset patch # User Kim F. Storm # Date 1011222243 0 # Node ID dee88a860452184e87a97b09b44542d30cfbbc6c # Parent 33c653c404572ccee1cd609ab93e12a15e0d1a35 (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. diff -r 33c653c40457 -r dee88a860452 src/w32term.c --- a/src/w32term.c Wed Jan 16 22:53:51 2002 +0000 +++ b/src/w32term.c Wed Jan 16 23:04:03 2002 +0000 @@ -9462,6 +9462,12 @@ 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 diff -r 33c653c40457 -r dee88a860452 src/xterm.c --- a/src/xterm.c Wed Jan 16 22:53:51 2002 +0000 +++ b/src/xterm.c Wed Jan 16 23:04:03 2002 +0000 @@ -11396,6 +11396,12 @@ 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