diff options
| author | Kim F. Storm | 2005-01-18 12:39:51 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2005-01-18 12:39:51 +0000 |
| commit | c6576d9d7a06f7072b9824572dd04c5e083fdd50 (patch) | |
| tree | 568222857d926b8b3df23af2cef216f41305df53 /src | |
| parent | 81f498dcef1a506461d112b98d82147e0c4def9f (diff) | |
| download | emacs-c6576d9d7a06f7072b9824572dd04c5e083fdd50.tar.gz emacs-c6576d9d7a06f7072b9824572dd04c5e083fdd50.zip | |
(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.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index bf06bba7df3..b0e2039a8c9 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -20603,6 +20603,28 @@ fast_find_position (w, charpos, hpos, vpos, x, y, stop) | |||
| 20603 | past_end = 1; | 20603 | past_end = 1; |
| 20604 | } | 20604 | } |
| 20605 | 20605 | ||
| 20606 | /* If whole rows or last part of a row came from a display overlay, | ||
| 20607 | row_containing_pos will skip over such rows because their end pos | ||
| 20608 | equals the start pos of the overlay or interval. Backtrack if we | ||
| 20609 | have a STOP object and previous row's end glyph came from STOP. */ | ||
| 20610 | if (!NILP (stop)) | ||
| 20611 | { | ||
| 20612 | struct glyph_row *prev = row-1; | ||
| 20613 | while ((prev = row - 1, prev >= first) | ||
| 20614 | && MATRIX_ROW_END_CHARPOS (prev) == charpos | ||
| 20615 | && prev->used[TEXT_AREA] > 0) | ||
| 20616 | { | ||
| 20617 | end = prev->glyphs[TEXT_AREA]; | ||
| 20618 | glyph = end + prev->used[TEXT_AREA]; | ||
| 20619 | while (--glyph >= end | ||
| 20620 | && INTEGERP (glyph->object)); | ||
| 20621 | if (glyph < end | ||
| 20622 | || !EQ (stop, glyph->object)) | ||
| 20623 | break; | ||
| 20624 | row = prev; | ||
| 20625 | } | ||
| 20626 | } | ||
| 20627 | |||
| 20606 | *x = row->x; | 20628 | *x = row->x; |
| 20607 | *y = row->y; | 20629 | *y = row->y; |
| 20608 | *vpos = MATRIX_ROW_VPOS (row, w->current_matrix); | 20630 | *vpos = MATRIX_ROW_VPOS (row, w->current_matrix); |