From: Gerd Moellmann Date: Tue, 17 Oct 2000 16:08:57 +0000 (+0000) Subject: (cursor_row_p): Take continued lines into account. X-Git-Tag: emacs-pretest-21.0.90~798 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9a0388816118bd7b4ae764fe1c1daa1bab762b5a;p=emacs.git (cursor_row_p): Take continued lines into account. --- diff --git a/src/ChangeLog b/src/ChangeLog index dc4239b16c0..4c8271bc7cb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,7 @@ 2000-10-17 Gerd Moellmann + * xdisp.c (cursor_row_p): Take continued lines into account. + * alloc.c (mark_object) [GC_CHECK_STRING_BYTES]: Check validity of string's size_byte. (check_string_bytes) [GC_CHECK_STRING_BYTES]: New function. diff --git a/src/xdisp.c b/src/xdisp.c index e9723f5272c..bc6a7ebd714 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -11663,27 +11663,26 @@ cursor_row_p (w, row) 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; + /* 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 1; + return cursor_row_p; }