diff options
| author | Kenichi Handa | 1998-05-07 06:41:12 +0000 |
|---|---|---|
| committer | Kenichi Handa | 1998-05-07 06:41:12 +0000 |
| commit | dbc08868a29abfbdd123cdf7ff475878dcb6cf69 (patch) | |
| tree | f1f3344ec45194590eda51121bac475b3e84a870 /src | |
| parent | e9227982cb82f5c12c1c63fb04d8f9c2afdee0ae (diff) | |
| download | emacs-dbc08868a29abfbdd123cdf7ff475878dcb6cf69.tar.gz emacs-dbc08868a29abfbdd123cdf7ff475878dcb6cf69.zip | |
(compute_motion): Fix bug of handling wide-column
character around right margin.
Diffstat (limited to 'src')
| -rw-r--r-- | src/indent.c | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/src/indent.c b/src/indent.c index 639cfdae818..fa1dc0a2932 100644 --- a/src/indent.c +++ b/src/indent.c | |||
| @@ -1223,7 +1223,9 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width, | |||
| 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; |
| @@ -1256,24 +1258,6 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width, | |||
| 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 | ||