comparison src/indent.c @ 21976:42c00d12d8d0

(compute_motion): Fix bug of handling wide-column character around right margin.
author Kenichi Handa <handa@m17n.org>
date Thu, 07 May 1998 06:41:12 +0000
parents 0c3d6e2c4176
children e80802548c11
comparison
equal deleted inserted replaced
21975:386e14726b59 21976:42c00d12d8d0
1221 prev_hpos = 0; 1221 prev_hpos = 0;
1222 } 1222 }
1223 } 1223 }
1224 1224
1225 /* Stop if past the target buffer position or screen position. */ 1225 /* Stop if past the target buffer position or screen position. */
1226 if (pos > to) 1226 if (pos > to
1227 || vpos > tovpos
1228 || vpos == tovpos && hpos > tohpos)
1227 { 1229 {
1228 /* Go back to the previous position. */ 1230 /* Go back to the previous position. */
1229 pos = prev_pos; 1231 pos = prev_pos;
1230 pos_byte = prev_pos_byte; 1232 pos_byte = prev_pos_byte;
1231 hpos = prev_hpos; 1233 hpos = prev_hpos;
1254 set VPOS back to previous line */ 1256 set VPOS back to previous line */
1255 vpos = vpos - 1; 1257 vpos = vpos - 1;
1256 break; 1258 break;
1257 } 1259 }
1258 1260
1259 if (vpos > tovpos || vpos == tovpos && hpos >= tohpos)
1260 {
1261 if (contin_hpos && prev_hpos == 0
1262 && ((hpos > tohpos && contin_hpos == width)
1263 || (wide_column_end_hpos > width)))
1264 { /* Line breaks because we can't put the character at the
1265 previous line any more. It is not the multi-column
1266 character continued in middle. Go back to previous
1267 buffer position, screen position, and set tab offset
1268 to previous value. It's the beginning of the
1269 line. */
1270 pos = prev_pos;
1271 pos_byte = prev_pos_byte;
1272 hpos = prev_hpos;
1273 tab_offset = prev_tab_offset;
1274 }
1275 break;
1276 }
1277 if (pos == ZV) /* We cannot go beyond ZV. Stop here. */ 1261 if (pos == ZV) /* We cannot go beyond ZV. Stop here. */
1278 break; 1262 break;
1279 1263
1280 prev_hpos = hpos; 1264 prev_hpos = hpos;
1281 prev_pos = pos; 1265 prev_pos = pos;