# HG changeset patch # User Gerd Moellmann # Date 957476740 0 # Node ID 12946e495506cb6a412af18f9d27d4d32d5033d4 # Parent 2b5f991123b8ab4938a443e412c31d77b345516b (insert_from_buffer_1): Adjust FROM position by number of inserted characters when BUF equals the current buffer, and PT is in front of or equal to FROM. diff -r 2b5f991123b8 -r 12946e495506 src/insdel.c --- a/src/insdel.c Thu May 04 20:21:58 2000 +0000 +++ b/src/insdel.c Thu May 04 21:45:40 2000 +0000 @@ -1546,7 +1546,11 @@ not including the combined-before bytes. */ intervals = BUF_INTERVALS (buf); if (outgoing_nbytes < BUF_Z_BYTE (buf) - BUF_BEG_BYTE (buf)) - intervals = copy_intervals (intervals, from, nchars); + { + if (buf == current_buffer && PT <= from) + from += nchars; + intervals = copy_intervals (intervals, from, nchars); + } /* Insert those intervals. */ graft_intervals_into_buffer (intervals, PT, nchars, current_buffer, inherit);