aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1997-04-14 08:50:23 +0000
committerRichard M. Stallman1997-04-14 08:50:23 +0000
commit9856e2185f488477d974c4d373b0838bad2737fd (patch)
tree1ea580f2976c581d09f456dc141923495d398b83 /src
parenta326c090b534152d0da3fb82644fb104e1e593e8 (diff)
downloademacs-9856e2185f488477d974c4d373b0838bad2737fd.tar.gz
emacs-9856e2185f488477d974c4d373b0838bad2737fd.zip
(adjust_markers): Don't be confused by the gap
when computing the arg to record_marker_adjustment.
Diffstat (limited to 'src')
-rw-r--r--src/insdel.c20
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)