# HG changeset patch # User Kim F. Storm # Date 1106051991 0 # Node ID 4b1b522ba215dc790d17c6d96094dde6849af1b2 # Parent f2e0c0de7b352cb1274ff57b56b747b7b9b50a66 (fast_find_position): Backtrack to find first row if charpos is inside a display overlay that spans multiple lines. diff -r f2e0c0de7b35 -r 4b1b522ba215 src/xdisp.c --- a/src/xdisp.c Tue Jan 18 12:39:33 2005 +0000 +++ b/src/xdisp.c Tue Jan 18 12:39:51 2005 +0000 @@ -20603,6 +20603,28 @@ past_end = 1; } + /* If whole rows or last part of a row came from a display overlay, + row_containing_pos will skip over such rows because their end pos + equals the start pos of the overlay or interval. Backtrack if we + have a STOP object and previous row's end glyph came from STOP. */ + if (!NILP (stop)) + { + struct glyph_row *prev = row-1; + while ((prev = row - 1, prev >= first) + && MATRIX_ROW_END_CHARPOS (prev) == charpos + && prev->used[TEXT_AREA] > 0) + { + end = prev->glyphs[TEXT_AREA]; + glyph = end + prev->used[TEXT_AREA]; + while (--glyph >= end + && INTEGERP (glyph->object)); + if (glyph < end + || !EQ (stop, glyph->object)) + break; + row = prev; + } + } + *x = row->x; *y = row->y; *vpos = MATRIX_ROW_VPOS (row, w->current_matrix);