comparison src/indent.c @ 17136:424932eba3e8

(compute_motion): When POS >= TO, don't call find_before_next_newline() as it assumes POS < TO.
author Kenichi Handa <handa@m17n.org>
date Wed, 05 Mar 1997 01:42:06 +0000
parents ded89d7e1575
children aaa25a87ae3d
comparison
equal deleted inserted replaced
17135:1814adcc2648 17136:424932eba3e8
1259 } 1259 }
1260 else if (c == '\n') 1260 else if (c == '\n')
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 {
1282 /* A visible line. */ 1287 /* A visible line. */
1283 vpos++; 1288 vpos++;
1293 else if (c == CR && selective < 0) 1298 else if (c == CR && selective < 0)
1294 { 1299 {
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. */
1302 if (pos > next_boundary) 1308 if (pos > next_boundary)
1303 next_boundary = pos; 1309 next_boundary = pos;