From 06d8227a86b9cb00e2657c418992f14766aa02b3 Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Thu, 4 May 2000 21:45:40 +0000 Subject: [PATCH] (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. --- src/insdel.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/insdel.c b/src/insdel.c index 9facec4cf34..06e638526bc 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -1546,7 +1546,11 @@ insert_from_buffer_1 (buf, from, nchars, inherit) 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); -- 2.39.5