+2011-08-16 Eli Zaretskii <eliz@gnu.org>
+
+ * 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 <kbrown@cornell.edu>
Fix memory allocation problems in Cygwin build (Bug#9273).
/* 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;