Mercurial > emacs
comparison src/indent.c @ 98211:bc06a22accf3
(Fvertical_motion): Use position reported by iterator
instead of PT for determining screen motion (bug#943).
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Wed, 17 Sep 2008 20:29:04 +0000 |
parents | 6a5fd5a377c2 |
children | 3b2bee2b95a4 |
comparison
equal
deleted
inserted
replaced
98210:2b86022634a8 | 98211:bc06a22accf3 |
---|---|
2107 if (XINT (lines) == 0 || IT_CHARPOS (it) > 0) | 2107 if (XINT (lines) == 0 || IT_CHARPOS (it) > 0) |
2108 move_it_by_lines (&it, XINT (lines), 0); | 2108 move_it_by_lines (&it, XINT (lines), 0); |
2109 } | 2109 } |
2110 else | 2110 else |
2111 { | 2111 { |
2112 if (IT_CHARPOS (it) > PT) | 2112 if (IT_CHARPOS (it) > it_start) |
2113 { | 2113 { |
2114 /* IT may move too far if truncate-lines is on and PT | 2114 /* IT may move too far if truncate-lines is on and PT |
2115 lies beyond the right margin. In that case, | 2115 lies beyond the right margin. In that case, |
2116 backtrack unless the starting point is on an image, | 2116 backtrack unless the starting point is on an image, |
2117 stretch glyph, composition, or Lisp string. */ | 2117 stretch glyph, composition, or Lisp string. */ |
2133 which might span multiple screen lines (e.g., if it's | 2133 which might span multiple screen lines (e.g., if it's |
2134 on a multi-line display string). We want to start | 2134 on a multi-line display string). We want to start |
2135 from the last line that it occupies. */ | 2135 from the last line that it occupies. */ |
2136 if (PT < ZV) | 2136 if (PT < ZV) |
2137 { | 2137 { |
2138 while (IT_CHARPOS (it) <= PT) | 2138 while (IT_CHARPOS (it) <= it_start) |
2139 { | 2139 { |
2140 it.vpos = 0; | 2140 it.vpos = 0; |
2141 move_it_by_lines (&it, 1, 0); | 2141 move_it_by_lines (&it, 1, 0); |
2142 } | 2142 } |
2143 if (XINT (lines) > 1) | 2143 if (XINT (lines) > 1) |