# HG changeset patch # User Gerd Moellmann # Date 971798898 0 # Node ID 04def897a1c6a9c3963a4153f8b69533a7b4925a # Parent c2db6313d3d828cb7166abfd11e66b3503a100d7 (cursor_row_p): Take continued lines into account. diff -r c2db6313d3d8 -r 04def897a1c6 src/xdisp.c --- 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; }