aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1998-05-25 22:33:38 +0000
committerRichard M. Stallman1998-05-25 22:33:38 +0000
commitf9ba10b0112e8e2b6c285bd96a92dcda96d3ebca (patch)
tree3e93a22d18b471c92db90083656403b3f32e12e4 /src
parent34c5d0ed52ac4a67bf4c3f1c37337a54fb5b8f11 (diff)
downloademacs-f9ba10b0112e8e2b6c285bd96a92dcda96d3ebca.tar.gz
emacs-f9ba10b0112e8e2b6c285bd96a92dcda96d3ebca.zip
(compute_motion): Check for past vpos/hpos target
before skipping invisible chars.
Diffstat (limited to 'src')
-rw-r--r--src/indent.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/indent.c b/src/indent.c
index 047f9e82262..0d49c9515cc 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -1095,6 +1095,26 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width,
1095 int pos_here = pos; 1095 int pos_here = pos;
1096 int newpos; 1096 int newpos;
1097 1097
1098 /* Don't skip invisible if we are already at the margin. */
1099 if (vpos > tovpos || vpos == tovpos && hpos >= tohpos)
1100 {
1101 if (contin_hpos && prev_hpos == 0
1102 && hpos > tohpos
1103 && (contin_hpos == width || wide_column_end_hpos > width))
1104 { /* Line breaks because we can't put the character at the
1105 previous line any more. It is not the multi-column
1106 character continued in middle. Go back to previous
1107 buffer position, screen position, and set tab offset
1108 to previous value. It's the beginning of the
1109 line. */
1110 pos = prev_pos;
1111 pos_byte = prev_pos_byte;
1112 hpos = prev_hpos;
1113 tab_offset = prev_tab_offset;
1114 }
1115 break;
1116 }
1117
1098 /* If the caller says that the screen position came from an earlier 1118 /* If the caller says that the screen position came from an earlier
1099 call to compute_motion, then we've already accounted for the 1119 call to compute_motion, then we've already accounted for the
1100 overlay strings at point. This is only true the first time 1120 overlay strings at point. This is only true the first time