aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa1997-03-05 01:42:06 +0000
committerKenichi Handa1997-03-05 01:42:06 +0000
commit626665b47b57d06c4b517700fd507193872efcd1 (patch)
treecfff8f067a46ae1b9d49723ecd76d0a6f60b3de4 /src
parenteb302e54e9032d8cad6e9457b878bb8dd36342a2 (diff)
downloademacs-626665b47b57d06c4b517700fd507193872efcd1.tar.gz
emacs-626665b47b57d06c4b517700fd507193872efcd1.zip
(compute_motion): When POS >= TO, don't call
find_before_next_newline() as it assumes POS < TO.
Diffstat (limited to 'src')
-rw-r--r--src/indent.c34
1 files changed, 20 insertions, 14 deletions
diff --git a/src/indent.c b/src/indent.c
index ea0de2a10d6..507b8e36cbe 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -1261,21 +1261,26 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width,
1261 { 1261 {
1262 if (selective > 0 && indented_beyond_p (pos, selective)) 1262 if (selective > 0 && indented_beyond_p (pos, selective))
1263 { 1263 {
1264 /* Skip any number of invisible lines all at once */ 1264 /* If (pos == to), we don't have to take care of
1265 do 1265 selective display. */
1266 pos = find_before_next_newline (pos, to, 1) + 1; 1266 if (pos < to)
1267 while (pos < to
1268 && indented_beyond_p (pos, selective));
1269 /* Allow for the " ..." that is displayed for them. */
1270 if (selective_rlen)
1271 { 1267 {
1272 hpos += selective_rlen; 1268 /* Skip any number of invisible lines all at once */
1273 if (hpos >= width) 1269 do
1274 hpos = width; 1270 pos = find_before_next_newline (pos, to, 1) + 1;
1271 while (pos < to
1272 && indented_beyond_p (pos, selective));
1273 /* Allow for the " ..." that is displayed for them. */
1274 if (selective_rlen)
1275 {
1276 hpos += selective_rlen;
1277 if (hpos >= width)
1278 hpos = width;
1279 }
1280 --pos;
1281 /* We have skipped the invis text, but not the
1282 newline after. */
1275 } 1283 }
1276 --pos;
1277 /* We have skipped the invis text, but not the
1278 newline after. */
1279 } 1284 }
1280 else 1285 else
1281 { 1286 {
@@ -1295,7 +1300,8 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width,
1295 /* In selective display mode, 1300 /* In selective display mode,
1296 everything from a ^M to the end of the line is invisible. 1301 everything from a ^M to the end of the line is invisible.
1297 Stop *before* the real newline. */ 1302 Stop *before* the real newline. */
1298 pos = find_before_next_newline (pos, to, 1); 1303 if (pos < to)
1304 pos = find_before_next_newline (pos, to, 1);
1299 /* If we just skipped next_boundary, 1305 /* If we just skipped next_boundary,
1300 loop around in the main while 1306 loop around in the main while
1301 and handle it. */ 1307 and handle it. */