# HG changeset patch # User Chong Yidong # Date 1220796975 0 # Node ID 638e09e8176452696aa6d39cc0f520605a9cf4f6 # Parent 8d0e9f83831b9a5fcd22c63e3a44863b895f6f6c (move_it_to): When moving by vpos, ensure that the iterator advances to the next line if the current line ends in a continued tab. diff -r 8d0e9f83831b -r 638e09e81764 src/xdisp.c --- a/src/xdisp.c Sun Sep 07 14:15:40 2008 +0000 +++ b/src/xdisp.c Sun Sep 07 14:16:15 2008 +0000 @@ -7216,8 +7216,18 @@ associated with the tab are displayed on the current line. Since it->current_x does not include these glyphs, we use it->last_visible_x instead. */ - it->continuation_lines_width += - (it->c == '\t') ? it->last_visible_x : it->current_x; + if (it->c == '\t') + { + it->continuation_lines_width += it->last_visible_x; + /* When moving by vpos, ensure that the iterator really + advances to the next line (bug#847). Fixme: do we + need to do this in other circumstances? */ + if ((op & MOVE_TO_VPOS) + && !(op & (MOVE_TO_X | MOVE_TO_POS))) + set_iterator_to_next (it, 0); + } + else + it->continuation_lines_width += it->current_x; break; default: