# HG changeset patch # User Kim F. Storm # Date 1114983754 0 # Node ID 9aeb4fcfe44de4bed67dbfacdc25ca1d410f278c # Parent 82672fec921f887c1937f1a2c8597bf3c722395f (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. diff -r 82672fec921f -r 9aeb4fcfe44d src/xdisp.c --- a/src/xdisp.c Sun May 01 20:04:11 2005 +0000 +++ b/src/xdisp.c Sun May 01 21:42:34 2005 +0000 @@ -5877,6 +5877,15 @@ { 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