Mercurial > emacs
changeset 32590:04def897a1c6
(cursor_row_p): Take continued lines into account.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Tue, 17 Oct 2000 16:08:18 +0000 |
parents | c2db6313d3d8 |
children | 4cbe2979f52b |
files | src/xdisp.c |
diffstat | 1 files changed, 18 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/src/xdisp.c Tue Oct 17 15:55:20 2000 +0000 +++ b/src/xdisp.c Tue Oct 17 16:08:18 2000 +0000 @@ -11663,27 +11663,26 @@ struct window *w; struct glyph_row *row; { + int cursor_row_p = 1; + if (PT == MATRIX_ROW_END_CHARPOS (row)) { - /* If PT is at the end of ROW, and that row ends with a - newline from a string, we don't want the cursor there. */ - if (row->end.overlay_string_index >= 0 - && ((truncate_partial_width_windows - && !WINDOW_FULL_WIDTH_P (w)) - || !NILP (current_buffer->truncate_lines))) - return 0; - - /* If PT is at the end of ROW, we normally want the cursor - at the start of the row below, except when ROW ends - at ZV or in the middle of a character. */ - if (MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (row) - || row->ends_at_zv_p) - return 1; - - return 0; - } - - return 1; + /* If the row ends with a newline from a string, we don't want + the cursor there (if the row is continued it doesn't end in a + newline). */ + if (CHARPOS (row->end.string_pos) >= 0 + || MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (row)) + cursor_row_p = row->continued_p; + + /* If the row ends at ZV, display the cursor at the end of that + row instead of at the start of the row below. */ + else if (row->ends_at_zv_p) + cursor_row_p = 1; + else + cursor_row_p = 0; + } + + return cursor_row_p; }