diff options
| author | Kim F. Storm | 2002-01-16 23:06:10 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2002-01-16 23:06:10 +0000 |
| commit | a2c6de8ecabbae4960714b7f630691fad3cbd899 (patch) | |
| tree | a35a5f2c17cf104854968fab6ef08a78469d0176 /src | |
| parent | 465c939061844b3e864393fa9583b5a2b263cfab (diff) | |
| download | emacs-a2c6de8ecabbae4960714b7f630691fad3cbd899.tar.gz emacs-a2c6de8ecabbae4960714b7f630691fad3cbd899.zip | |
(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 'src')
| -rw-r--r-- | src/ChangeLog | 2 | ||||
| -rw-r--r-- | src/w32term.c | 6 | ||||
| -rw-r--r-- | src/xterm.c | 6 |
3 files changed, 14 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 24df4986e42..57e508f9f27 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -4,6 +4,8 @@ | |||
| 4 | is invisible. This can happen if cursor is on top line of a | 4 | is invisible. This can happen if cursor is on top line of a |
| 5 | window, and we switch to a buffer with a header line. | 5 | window, and we switch to a buffer with a header line. |
| 6 | 6 | ||
| 7 | * w32term.c (x_erase_phys_cursor): ditto. | ||
| 8 | |||
| 7 | 2002-01-16 Pavel Jan,Bm(Bk <Pavel@Janik.cz> | 9 | 2002-01-16 Pavel Jan,Bm(Bk <Pavel@Janik.cz> |
| 8 | 10 | ||
| 9 | * xterm.c (XTread_socket) [!USE_X_TOOLKIT]: Compute the value of | 11 | * xterm.c (XTread_socket) [!USE_X_TOOLKIT]: Compute the value of |
diff --git a/src/w32term.c b/src/w32term.c index 9fe40866edc..af83ae53a2a 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -9462,6 +9462,12 @@ x_erase_phys_cursor (w) | |||
| 9462 | if (!cursor_row->enabled_p) | 9462 | if (!cursor_row->enabled_p) |
| 9463 | goto mark_cursor_off; | 9463 | goto mark_cursor_off; |
| 9464 | 9464 | ||
| 9465 | /* If row is completely invisible, don't attempt to delete a cursor which | ||
| 9466 | isn't there. This may happen if cursor is at top of window, and | ||
| 9467 | we switch to a buffer with a header line in that window. */ | ||
| 9468 | if (cursor_row->visible_height <= 0) | ||
| 9469 | goto mark_cursor_off; | ||
| 9470 | |||
| 9465 | /* This can happen when the new row is shorter than the old one. | 9471 | /* This can happen when the new row is shorter than the old one. |
| 9466 | In this case, either x_draw_glyphs or clear_end_of_line | 9472 | In this case, either x_draw_glyphs or clear_end_of_line |
| 9467 | should have cleared the cursor. Note that we wouldn't be | 9473 | should have cleared the cursor. Note that we wouldn't be |
diff --git a/src/xterm.c b/src/xterm.c index 77860842d57..a428b4af8a6 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -11396,6 +11396,12 @@ x_erase_phys_cursor (w) | |||
| 11396 | if (!cursor_row->enabled_p) | 11396 | if (!cursor_row->enabled_p) |
| 11397 | goto mark_cursor_off; | 11397 | goto mark_cursor_off; |
| 11398 | 11398 | ||
| 11399 | /* If row is completely invisible, don't attempt to delete a cursor which | ||
| 11400 | isn't there. This can happen if cursor is at top of a window, and | ||
| 11401 | we switch to a buffer with a header line in that window. */ | ||
| 11402 | if (cursor_row->visible_height <= 0) | ||
| 11403 | goto mark_cursor_off; | ||
| 11404 | |||
| 11399 | /* This can happen when the new row is shorter than the old one. | 11405 | /* This can happen when the new row is shorter than the old one. |
| 11400 | In this case, either x_draw_glyphs or clear_end_of_line | 11406 | In this case, either x_draw_glyphs or clear_end_of_line |
| 11401 | should have cleared the cursor. Note that we wouldn't be | 11407 | should have cleared the cursor. Note that we wouldn't be |