start_vpos = MATRIX_ROW_VPOS (start_row, w->current_matrix);
}
- /* If we have reached alignment,
- we can copy the rest of the rows. */
- if (IT_CHARPOS (it) == CHARPOS (start))
+ /* If we have reached alignment, we can copy the rest of the
+ rows. */
+ if (IT_CHARPOS (it) == CHARPOS (start)
+ /* Don't accept "alignment" inside a display vector,
+ since start_row could have started in the middle of
+ that same display vector (thus their character
+ positions match), and we have no way of telling if
+ that is the case. */
+ && it.current.dpvec_index < 0)
break;
if (display_line (&it))
last_text_row = it.glyph_row - 1;
+
}
/* A value of current_y < last_visible_y means that we stopped