+2009-11-21 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (set_cursor_from_row): Fix cursor positioning on empty
+ lines when integer values of `cursor' property is used on display
+ strings.
+
2009-11-14 Eli Zaretskii <eliz@gnu.org>
* xdisp.c (init_iterator, text_outside_line_unchanged_p)
/* Non-zero means we've seen at least one glyph that came from a
display string. */
int string_seen = 0;
- /* Largest buffer position seen during scan of glyph row. */
- EMACS_INT bpos_max = 0;
+ /* Largest buffer position seen so far during scan of glyph row. */
+ EMACS_INT bpos_max = last_pos;
/* Last buffer position covered by an overlay string with an integer
`cursor' property. */
EMACS_INT bpos_covered = 0;
/* If the `cursor' property covers buffer positions up
to and including point, we should display cursor on
this glyph. */
- if (bpos_covered >= pt_old)
+ /* Implementation note: bpos_max == pt_old when, e.g.,
+ we are in an empty line, where bpos_max is set to
+ MATRIX_ROW_START_CHARPOS, see above. */
+ if (bpos_max <= pt_old && bpos_covered >= pt_old)
{
cursor = glyph;
break;
/* If the `cursor' property covers buffer positions up
to and including point, we should display cursor on
this glyph. */
- if (bpos_covered >= pt_old)
+ if (bpos_max <= pt_old && bpos_covered >= pt_old)
{
cursor = glyph;
break;