From 173cbca8b12f9eddf632ccd8fe36104785eeaa2a Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Wed, 7 Jun 2000 09:05:58 +0000 Subject: [PATCH] (display_line): Fix code deciding in which line to put the cursor. --- src/ChangeLog | 5 +++++ src/xdisp.c | 20 ++++++++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index a208ad0be45..fb734387aa4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2000-06-07 Gerd Moellmann + + * xdisp.c (display_line): Fix code deciding in which line to + put the cursor. + 2000-06-07 Kenichi Handa * fileio.c (e_write): Free composition data if stored in diff --git a/src/xdisp.c b/src/xdisp.c index d6b8ed694b3..d81a5c4c9b2 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -11553,16 +11553,20 @@ display_line (it) /* Remember the position at which this line ends. */ row->end = it->current; - /* Maybe set the cursor. We want to set the cursor on the first - glyph having position PT. This means it doesn't matter if the - row is continued and ends in the middle of the character at PT. - If some glyphs of that character are in this row, this is the - right row to put the cursor on. */ + /* Maybe set the cursor. */ if (it->w->cursor.vpos < 0 && PT >= MATRIX_ROW_START_CHARPOS (row) - && PT <= MATRIX_ROW_END_CHARPOS (row) - && !(PT == ZV && !row->ends_at_zv_p)) - set_cursor_from_row (it->w, row, it->w->desired_matrix, 0, 0, 0, 0); + && PT <= MATRIX_ROW_END_CHARPOS (row)) + { + /* Also see redisplay_window, case cursor movement in unchanged + window. */ + if (MATRIX_ROW_END_CHARPOS (row) == PT + && !MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (row) + && !row->ends_at_zv_p) + ; + else + set_cursor_from_row (it->w, row, it->w->desired_matrix, 0, 0, 0, 0); + } /* Highlight trailing whitespace. */ if (!NILP (Vshow_trailing_whitespace)) -- 2.39.2