From: Eli Zaretskii Date: Fri, 2 Mar 2012 11:35:51 +0000 (+0200) Subject: Fix bug #10902 with cursor positioning at EOB. X-Git-Tag: emacs-pretest-24.0.05~191 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=de0100f20b41cda924055c3c80e0b85db8386110;p=emacs.git 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. --- diff --git a/src/ChangeLog b/src/ChangeLog index ecfd83eef37..c84854f2827 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 644658b3136..f98df491f59 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++;