From: Chong Yidong Date: Sun, 7 Sep 2008 14:16:15 +0000 (+0000) Subject: (move_it_to): When moving by vpos, ensure that the iterator advances X-Git-Tag: emacs-pretest-23.0.90~2971 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5b6f0284d0327a15f0e68bb4c4d354846c421dbc;p=emacs.git (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 --git a/src/xdisp.c b/src/xdisp.c index 82c9e82effa..a6d1a82eb33 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -7216,8 +7216,18 @@ move_it_to (it, to_charpos, to_x, to_y, to_vpos, op) 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: