[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r112745: Fix bug #14476 with posn-at-
From: |
Eli Zaretskii |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r112745: Fix bug #14476 with posn-at-point and glyphs from display vector. |
Date: |
Mon, 27 May 2013 19:54:33 +0300 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 112745
fixes bug: http://debbugs.gnu.org/14476
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Mon 2013-05-27 19:54:33 +0300
message:
Fix bug #14476 with posn-at-point and glyphs from display vector.
src/xdisp.c (pos_visible_p): When CHARPOS is displayed frrom a
display vector, and we backtrack, handle the case that the
previous character position is also displayed from a display
vector or covered by a display string or image.
modified:
src/ChangeLog
src/xdisp.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2013-05-25 11:14:38 +0000
+++ b/src/ChangeLog 2013-05-27 16:54:33 +0000
@@ -1,3 +1,10 @@
+2013-05-27 Eli Zaretskii <address@hidden>
+
+ * xdisp.c (pos_visible_p): When CHARPOS is displayed frrom a
+ display vector, and we backtrack, handle the case that the
+ previous character position is also displayed from a display
+ vector or covered by a display string or image. (Bug#14476)
+
2013-05-25 Jan Djärv <address@hidden>
* xfns.c (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Remove.
=== modified file 'src/xdisp.c'
--- a/src/xdisp.c 2013-05-21 05:27:33 +0000
+++ b/src/xdisp.c 2013-05-27 16:54:33 +0000
@@ -1371,18 +1371,41 @@
top_x = it.glyph_row->x;
else
{
- struct it it2;
+ struct it it2, it2_prev;
+ /* The idea is to get to the previous buffer
+ position, consume the character there, and use
+ the pixel coordinates we get after that. But if
+ the previous buffer position is also displayed
+ from a display vector, we need to consume all of
+ the glyphs from that display vector. */
start_display (&it2, w, top);
move_it_to (&it2, charpos - 1, -1, -1, -1, MOVE_TO_POS);
- get_next_display_element (&it2);
- PRODUCE_GLYPHS (&it2);
- if (ITERATOR_AT_END_OF_LINE_P (&it2)
- || it2.current_x > it2.last_visible_x)
+ /* If we didn't get to CHARPOS - 1, there's some
+ replacing display property at that position, and
+ we stopped after it. That is exactly the place
+ whose coordinates we want. */
+ if (IT_CHARPOS (it2) != charpos - 1)
+ it2_prev = it2;
+ else
+ {
+ /* Iterate until we get out of the display
+ vector that displays the character at
+ CHARPOS - 1. */
+ do {
+ get_next_display_element (&it2);
+ PRODUCE_GLYPHS (&it2);
+ it2_prev = it2;
+ set_iterator_to_next (&it2, 1);
+ } while (it2.method == GET_FROM_DISPLAY_VECTOR
+ && IT_CHARPOS (it2) < charpos);
+ }
+ if (ITERATOR_AT_END_OF_LINE_P (&it2_prev)
+ || it2_prev.current_x > it2_prev.last_visible_x)
top_x = it.glyph_row->x;
else
{
- top_x = it2.current_x;
- top_y = it2.current_y;
+ top_x = it2_prev.current_x;
+ top_y = it2_prev.current_y;
}
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r112745: Fix bug #14476 with posn-at-point and glyphs from display vector.,
Eli Zaretskii <=