comparison src/indent.c @ 58308:5358f62b0795

(Fvertical_motion): Undo 2004-11-16 change. Instead, move back again if reseating moves too far ahead.
author Kim F. Storm <storm@cua.dk>
date Thu, 18 Nov 2004 11:00:14 +0000
parents 1bc0c9f25148
children ae080fc5eb58 b637c617432f
comparison
equal deleted inserted replaced
58307:8e5e564777ba 58308:5358f62b0795
2076 do this, we start moving with IT->current_x == 0, while PT is 2076 do this, we start moving with IT->current_x == 0, while PT is
2077 really at some x > 0. The effect is, in continuation lines, that 2077 really at some x > 0. The effect is, in continuation lines, that
2078 we end up with the iterator placed at where it thinks X is 0, 2078 we end up with the iterator placed at where it thinks X is 0,
2079 while the end position is really at some X > 0, the same X that 2079 while the end position is really at some X > 0, the same X that
2080 PT had. */ 2080 PT had. */
2081 if (XINT (lines) < 0) 2081 reseat_at_previous_visible_line_start (&it);
2082 { 2082 it.current_x = it.hpos = 0;
2083 reseat_at_previous_visible_line_start (&it); 2083 move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS);
2084 it.current_x = it.hpos = 0; 2084
2085 move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS); 2085 /* Move back if we got too far. This may happen if
2086 it.vpos = 0; 2086 truncate-lines is on and PT is beyond right margin. */
2087 } 2087 if (IT_CHARPOS (it) > PT && XINT (lines) > 0)
2088 else 2088 move_it_by_lines (&it, -1, 0);
2089 move_it_by_lines (&it, 0, 0); 2089
2090 2090 it.vpos = 0;
2091 if (XINT (lines) != 0) 2091 if (XINT (lines) != 0)
2092 move_it_by_lines (&it, XINT (lines), 0); 2092 move_it_by_lines (&it, XINT (lines), 0);
2093 2093
2094 SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it)); 2094 SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it));
2095 } 2095 }