diff src/insdel.c @ 28813:12946e495506

(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.
author Gerd Moellmann <gerd@gnu.org>
date Thu, 04 May 2000 21:45:40 +0000
parents 4b675266db04
children 9e67ee582342
line wrap: on
line diff
--- 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);