diff options
| author | Kim F. Storm | 2004-11-21 12:56:53 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2004-11-21 12:56:53 +0000 |
| commit | 24a06d04fd35b150a61f5ce51446f08126b6ed3f (patch) | |
| tree | 5bb71200b963fc1b6711c696facdb9cbe037a44f /src | |
| parent | f1a613896729a0cbbd8376e9a8f779fb6dadbc58 (diff) | |
| download | emacs-24a06d04fd35b150a61f5ce51446f08126b6ed3f.tar.gz emacs-24a06d04fd35b150a61f5ce51446f08126b6ed3f.zip | |
(Fvertical_motion): Fix last change. Use another
method to detect if iterator moved too far ahead after reseat.
Diffstat (limited to 'src')
| -rw-r--r-- | src/indent.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/indent.c b/src/indent.c index f4a383b6d07..ce274f65a1f 100644 --- a/src/indent.c +++ b/src/indent.c | |||
| @@ -2069,6 +2069,8 @@ whether or not it is currently displayed in some window. */) | |||
| 2069 | } | 2069 | } |
| 2070 | else | 2070 | else |
| 2071 | { | 2071 | { |
| 2072 | int it_start; | ||
| 2073 | |||
| 2072 | SET_TEXT_POS (pt, PT, PT_BYTE); | 2074 | SET_TEXT_POS (pt, PT, PT_BYTE); |
| 2073 | start_display (&it, w, pt); | 2075 | start_display (&it, w, pt); |
| 2074 | 2076 | ||
| @@ -2078,13 +2080,14 @@ whether or not it is currently displayed in some window. */) | |||
| 2078 | we end up with the iterator placed at where it thinks X is 0, | 2080 | 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 | 2081 | while the end position is really at some X > 0, the same X that |
| 2080 | PT had. */ | 2082 | PT had. */ |
| 2083 | it_start = IT_CHARPOS (it); | ||
| 2081 | reseat_at_previous_visible_line_start (&it); | 2084 | reseat_at_previous_visible_line_start (&it); |
| 2082 | it.current_x = it.hpos = 0; | 2085 | it.current_x = it.hpos = 0; |
| 2083 | move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS); | 2086 | move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS); |
| 2084 | 2087 | ||
| 2085 | /* Move back if we got too far. This may happen if | 2088 | /* Move back if we got too far. This may happen if |
| 2086 | truncate-lines is on and PT is beyond right margin. */ | 2089 | truncate-lines is on and PT is beyond right margin. */ |
| 2087 | if (IT_CHARPOS (it) > PT && it.vpos > 0 && XINT (lines) > 0) | 2090 | if (IT_CHARPOS (it) > it_start && XINT (lines) > 0) |
| 2088 | move_it_by_lines (&it, -1, 0); | 2091 | move_it_by_lines (&it, -1, 0); |
| 2089 | 2092 | ||
| 2090 | it.vpos = 0; | 2093 | it.vpos = 0; |