aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKim F. Storm <[email protected]>2005-01-18 12:39:51 +0000
committerKim F. Storm <[email protected]>2005-01-18 12:39:51 +0000
commitc6576d9d7a06f7072b9824572dd04c5e083fdd50 (patch)
tree568222857d926b8b3df23af2cef216f41305df53 /src
parent81f498dcef1a506461d112b98d82147e0c4def9f (diff)
(fast_find_position): Backtrack to find first row if
charpos is inside a display overlay that spans multiple lines.
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index bf06bba7df..b0e2039a8c 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -20603,6 +20603,28 @@ fast_find_position (w, charpos, hpos, vpos, x, y, stop)
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);