summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>1998-02-09 11:16:35 +0000
committerAndreas Schwab <schwab@suse.de>1998-02-09 11:16:35 +0000
commitb848fa0cea2196f9c6a2be96a54a8c1fe8ce2099 (patch)
treeef482883e5e8e581b96ee2ebdff54cd698dec087
parentcf88211f459958ddc4147bf28207d39a4b67e7f3 (diff)
downloademacs-b848fa0cea2196f9c6a2be96a54a8c1fe8ce2099.tar.gz
(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.c21
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,
&& width + 1 < FRAME_WIDTH (XFRAME (WINDOW_FRAME (win))))
|| !NILP (current_buffer->truncate_lines))
{
- /* Truncating: skip to newline. */
- if (pos <= to) /* This IF is needed because we may past TO */
+ /* Truncating: skip to newline, unless we are already past
+ TO (we need to go back below). */
+ if (pos <= to)
{
pos = find_before_next_newline (pos, to, 1);
pos_byte = CHAR_TO_BYTE (pos);
+ hpos = width;
+ /* If we just skipped next_boundary,
+ loop around in the main while
+ and handle it. */
+ if (pos >= next_boundary)
+ next_boundary = pos + 1;
+ prev_hpos = width;
+ prev_tab_offset = tab_offset;
}
- hpos = width;
- /* If we just skipped next_boundary,
- loop around in the main while
- and handle it. */
- if (pos >= next_boundary)
- next_boundary = pos + 1;
- prev_hpos = width;
- prev_tab_offset = tab_offset;
}
else
{