From b215eee57d8427ac896f42a9546930cd852a1637 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 16 Aug 2011 17:28:19 +0300 Subject: [PATCH] Fix cursor positioning at end of buffer under bidi display. src/xdisp.c (set_cursor_from_row): Don't accept a previous candidate if it fails the cursor_row_p test. Fixes cursor positioning at ZV. --- src/ChangeLog | 5 +++++ src/xdisp.c | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 2364f71c6a4..5bc07722191 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-08-16 Eli Zaretskii + + * xdisp.c (set_cursor_from_row): Don't accept a previous candidate + if it fails the cursor_row_p test. Fixes cursor positioning at ZV. + 2011-08-16 Ken Brown Fix memory allocation problems in Cygwin build (Bug#9273). diff --git a/src/xdisp.c b/src/xdisp.c index b83d4bac743..ea98ac575d9 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -13751,11 +13751,13 @@ set_cursor_from_row (struct window *w, struct glyph_row *row, /* that candidate is not the row we are processing */ && MATRIX_ROW (matrix, w->cursor.vpos) != row /* Make sure cursor.vpos specifies a row whose start and end - charpos occlude point. This is because some callers of this - function leave cursor.vpos at the row where the cursor was - displayed during the last redisplay cycle. */ + charpos occlude point, and it is valid candidate for being a + cursor-row. This is because some callers of this function + leave cursor.vpos at the row where the cursor was displayed + during the last redisplay cycle. */ && MATRIX_ROW_START_CHARPOS (MATRIX_ROW (matrix, w->cursor.vpos)) <= pt_old - && pt_old <= MATRIX_ROW_END_CHARPOS (MATRIX_ROW (matrix, w->cursor.vpos))) + && pt_old <= MATRIX_ROW_END_CHARPOS (MATRIX_ROW (matrix, w->cursor.vpos)) + && cursor_row_p (MATRIX_ROW (matrix, w->cursor.vpos))) { struct glyph *g1 = MATRIX_ROW_GLYPH_START (matrix, w->cursor.vpos) + w->cursor.hpos; -- 2.39.2