Commit 9856e218 authored by Richard M. Stallman's avatar Richard M. Stallman

(adjust_markers): Don't be confused by the gap

when computing the arg to record_marker_adjustment.
parent a326c090
......@@ -274,8 +274,24 @@ adjust_markers (from, to, amount)
but then this range contains no markers. */
if (mpos > from + amount && mpos <= from)
{
record_marker_adjustment (marker, from + amount - mpos);
mpos = from + amount;
int before = mpos;
int after = from + amount;
mpos = after;
/* Compute the before and after positions
as buffer positions. */
if (before > GPT + GAP_SIZE)
before -= GAP_SIZE;
else if (before > GPT)
before = GPT;
if (after > GPT + GAP_SIZE)
after -= GAP_SIZE;
else if (after > GPT)
after = GPT;
record_marker_adjustment (marker, after - before);
}
}
if (mpos > from && mpos <= to)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment