diff options
author | Kim F. Storm <storm@cua.dk> | 2005-05-01 21:42:34 +0000 |
---|---|---|
committer | Kim F. Storm <storm@cua.dk> | 2005-05-01 21:42:34 +0000 |
commit | 20b44bb85a371689df831747244dde427dbfa52b (patch) | |
tree | ba5e2cbac517e5173aea8850386ccf62f61f476d /src/xdisp.c | |
parent | bec0b768694180802a832c870af052dec0ac27b3 (diff) | |
download | emacs-20b44bb85a371689df831747244dde427dbfa52b.tar.gz |
(move_it_in_display_line_to): Stop if we move beyond TO_CHARPOS.
This may happen if last glyphs was an image or stretch glyph.
Diffstat (limited to 'src/xdisp.c')
-rw-r--r-- | src/xdisp.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 19323ffa6d5..80b2981c5be 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -5877,6 +5877,15 @@ move_it_in_display_line_to (it, to_charpos, to_x, op) { int x, i, ascent = 0, descent = 0; + /* Stop if we move beyond TO_CHARPOS (after an image or stretch glyph). */ + if ((op & MOVE_TO_POS) != 0 + && BUFFERP (it->object) + && IT_CHARPOS (*it) > to_charpos) + { + result = MOVE_POS_MATCH_OR_ZV; + break; + } + /* Stop when ZV reached. We used to stop here when TO_CHARPOS reached as well, but that is too soon if this glyph does not fit on this line. So we handle it |