changeset 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 2b5f991123b8
children 7bb3a2b7ff29
files src/insdel.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
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);