diff options
| author | Chong Yidong | 2008-01-26 01:00:44 +0000 |
|---|---|---|
| committer | Chong Yidong | 2008-01-26 01:00:44 +0000 |
| commit | a5bafa401fc141892429a27ae18d46e8dde84446 (patch) | |
| tree | b772de1e65e79b7369cfe13b588dfc4b3e7a4e6a | |
| parent | 3ac7a21e51347773559ffd8d133845aaf73eb9fd (diff) | |
| download | emacs-a5bafa401fc141892429a27ae18d46e8dde84446.tar.gz emacs-a5bafa401fc141892429a27ae18d46e8dde84446.zip | |
(pos_visible_p): Handle the case where charpos falls on
invisible text covered with an ellipsis.
| -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 8c1b2b945fe..d8619cdfa9e 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -1321,6 +1321,28 @@ pos_visible_p (w, charpos, x, y, rtop, rbot, rowh, vpos) | |||
| 1321 | visible_p = 1; | 1321 | visible_p = 1; |
| 1322 | if (visible_p) | 1322 | if (visible_p) |
| 1323 | { | 1323 | { |
| 1324 | Lisp_Object window, prop; | ||
| 1325 | |||
| 1326 | XSETWINDOW (window, w); | ||
| 1327 | prop = Fget_char_property (make_number (it.position.charpos), | ||
| 1328 | Qinvisible, window); | ||
| 1329 | |||
| 1330 | /* If charpos coincides with invisible text covered with an | ||
| 1331 | ellipsis, use the first glyph of the ellipsis to compute | ||
| 1332 | the pixel positions. */ | ||
| 1333 | if (TEXT_PROP_MEANS_INVISIBLE (prop) == 2) | ||
| 1334 | { | ||
| 1335 | struct glyph_row *row = it.glyph_row; | ||
| 1336 | struct glyph *glyph = row->glyphs[TEXT_AREA]; | ||
| 1337 | struct glyph *end = glyph + row->used[TEXT_AREA]; | ||
| 1338 | int x = row->x; | ||
| 1339 | |||
| 1340 | for (; glyph < end && glyph->charpos < charpos; glyph++) | ||
| 1341 | x += glyph->pixel_width; | ||
| 1342 | |||
| 1343 | top_x = x; | ||
| 1344 | } | ||
| 1345 | |||
| 1324 | *x = top_x; | 1346 | *x = top_x; |
| 1325 | *y = max (top_y + max (0, it.max_ascent - it.ascent), window_top_y); | 1347 | *y = max (top_y + max (0, it.max_ascent - it.ascent), window_top_y); |
| 1326 | *rtop = max (0, window_top_y - top_y); | 1348 | *rtop = max (0, window_top_y - top_y); |