diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/insdel.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/insdel.c b/src/insdel.c index aa431f58837..12b7eedb58b 100644 --- a/src/insdel.c +++ b/src/insdel.c | |||
| @@ -274,8 +274,24 @@ adjust_markers (from, to, amount) | |||
| 274 | but then this range contains no markers. */ | 274 | but then this range contains no markers. */ |
| 275 | if (mpos > from + amount && mpos <= from) | 275 | if (mpos > from + amount && mpos <= from) |
| 276 | { | 276 | { |
| 277 | record_marker_adjustment (marker, from + amount - mpos); | 277 | int before = mpos; |
| 278 | mpos = from + amount; | 278 | int after = from + amount; |
| 279 | |||
| 280 | mpos = after; | ||
| 281 | |||
| 282 | /* Compute the before and after positions | ||
| 283 | as buffer positions. */ | ||
| 284 | if (before > GPT + GAP_SIZE) | ||
| 285 | before -= GAP_SIZE; | ||
| 286 | else if (before > GPT) | ||
| 287 | before = GPT; | ||
| 288 | |||
| 289 | if (after > GPT + GAP_SIZE) | ||
| 290 | after -= GAP_SIZE; | ||
| 291 | else if (after > GPT) | ||
| 292 | after = GPT; | ||
| 293 | |||
| 294 | record_marker_adjustment (marker, after - before); | ||
| 279 | } | 295 | } |
| 280 | } | 296 | } |
| 281 | if (mpos > from && mpos <= to) | 297 | if (mpos > from && mpos <= to) |