diff options
| author | Andreas Schwab | 1998-02-09 11:16:35 +0000 |
|---|---|---|
| committer | Andreas Schwab | 1998-02-09 11:16:35 +0000 |
| commit | 529724fec7ce48fe562991a753736da2009bb7df (patch) | |
| tree | 067a314c821625b8a04c54186465477a5b63e72e | |
| parent | 3135e9fd79018f6331ce0c37116f64032a8c81a1 (diff) | |
| download | emacs-529724fec7ce48fe562991a753736da2009bb7df.tar.gz emacs-529724fec7ce48fe562991a753736da2009bb7df.zip | |
(compute_motion): If right margin is reached and we are
truncating don't clobber PREV_HPOS if we are already past TO.
| -rw-r--r-- | src/indent.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/indent.c b/src/indent.c index a067db21440..28a661dd9f1 100644 --- a/src/indent.c +++ b/src/indent.c | |||
| @@ -1165,20 +1165,21 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width, | |||
| 1165 | && width + 1 < FRAME_WIDTH (XFRAME (WINDOW_FRAME (win)))) | 1165 | && width + 1 < FRAME_WIDTH (XFRAME (WINDOW_FRAME (win)))) |
| 1166 | || !NILP (current_buffer->truncate_lines)) | 1166 | || !NILP (current_buffer->truncate_lines)) |
| 1167 | { | 1167 | { |
| 1168 | /* Truncating: skip to newline. */ | 1168 | /* Truncating: skip to newline, unless we are already past |
| 1169 | if (pos <= to) /* This IF is needed because we may past TO */ | 1169 | TO (we need to go back below). */ |
| 1170 | if (pos <= to) | ||
| 1170 | { | 1171 | { |
| 1171 | pos = find_before_next_newline (pos, to, 1); | 1172 | pos = find_before_next_newline (pos, to, 1); |
| 1172 | pos_byte = CHAR_TO_BYTE (pos); | 1173 | pos_byte = CHAR_TO_BYTE (pos); |
| 1174 | hpos = width; | ||
| 1175 | /* If we just skipped next_boundary, | ||
| 1176 | loop around in the main while | ||
| 1177 | and handle it. */ | ||
| 1178 | if (pos >= next_boundary) | ||
| 1179 | next_boundary = pos + 1; | ||
| 1180 | prev_hpos = width; | ||
| 1181 | prev_tab_offset = tab_offset; | ||
| 1173 | } | 1182 | } |
| 1174 | hpos = width; | ||
| 1175 | /* If we just skipped next_boundary, | ||
| 1176 | loop around in the main while | ||
| 1177 | and handle it. */ | ||
| 1178 | if (pos >= next_boundary) | ||
| 1179 | next_boundary = pos + 1; | ||
| 1180 | prev_hpos = width; | ||
| 1181 | prev_tab_offset = tab_offset; | ||
| 1182 | } | 1183 | } |
| 1183 | else | 1184 | else |
| 1184 | { | 1185 | { |