From de0100f20b41cda924055c3c80e0b85db8386110 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 2 Mar 2012 13:35:51 +0200 Subject: [PATCH] Fix bug #10902 with cursor positioning at EOB. src/xdisp.c (try_window_reusing_current_matrix): Don't move cursor position past the first glyph_row that ends at ZV. --- src/ChangeLog | 5 +++++ src/xdisp.c | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index ecfd83eef3..c84854f282 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-03-02 Eli Zaretskii + + * xdisp.c (try_window_reusing_current_matrix): Don't move cursor + position past the first glyph_row that ends at ZV. (Bug#10902) + 2012-03-02 Glenn Morris * buffer.c (buffer-list-update-hook): Doc fix. diff --git a/src/xdisp.c b/src/xdisp.c index 644658b313..f98df491f5 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -16322,7 +16322,10 @@ try_window_reusing_current_matrix (struct window *w) ++first_row_to_display) { if (PT >= MATRIX_ROW_START_CHARPOS (first_row_to_display) - && PT < MATRIX_ROW_END_CHARPOS (first_row_to_display)) + && (PT < MATRIX_ROW_END_CHARPOS (first_row_to_display) + || (PT == MATRIX_ROW_END_CHARPOS (first_row_to_display) + && first_row_to_display->ends_at_zv_p + && pt_row == NULL))) pt_row = first_row_to_display; } @@ -16414,7 +16417,9 @@ try_window_reusing_current_matrix (struct window *w) if (pt_row) { for (row = MATRIX_ROW (w->current_matrix, w->cursor.vpos); - row < bottom_row && PT >= MATRIX_ROW_END_CHARPOS (row); + row < bottom_row + && PT >= MATRIX_ROW_END_CHARPOS (row) + && !row->ends_at_zv_p; row++) { w->cursor.vpos++; -- 2.20.1