summaryrefslogtreecommitdiff
path: root/mac
diff options
context:
space:
mode:
authorKim F. Storm <storm@cua.dk>2002-01-28 22:55:59 +0000
committerKim F. Storm <storm@cua.dk>2002-01-28 22:55:59 +0000
commit8e3602e4de1f33d499729e01dd8f81a3f21cbb7d (patch)
tree51313905c045032312e9660d195c41310ca4b080 /mac
parent6a493ac86ef471a669198cabd5d0047fbda182a7 (diff)
downloademacs-8e3602e4de1f33d499729e01dd8f81a3f21cbb7d.tar.gz
(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.
Diffstat (limited to 'mac')
-rw-r--r--mac/src/macterm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/mac/src/macterm.c b/mac/src/macterm.c
index 4893a551f8f..3def0223a92 100644
--- a/mac/src/macterm.c
+++ b/mac/src/macterm.c
@@ -8458,6 +8458,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