changeset 89598:dd3ec25f37e8

(insert_from_gap): Adjust intervals correctly.
author Kenichi Handa <handa@m17n.org>
date Thu, 16 Oct 2003 00:44:43 +0000
parents 237980c2b1d3
children 161f8ca95885
files src/insdel.c
diffstat 1 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/insdel.c	Sun Oct 12 23:00:15 2003 +0000
+++ b/src/insdel.c	Thu Oct 16 00:44:43 2003 +0000
@@ -1182,13 +1182,16 @@
   if (GPT_BYTE < GPT)
     abort ();
 
-  adjust_overlays_for_insert (GPT, nchars);
-  adjust_markers_for_insert (GPT, GPT_BYTE,
-			     GPT + nchars, GPT_BYTE + nbytes,
-			     0);
+  adjust_overlays_for_insert (GPT - nchars, nchars);
+  adjust_markers_for_insert (GPT - nchars, GPT_BYTE - nbytes,
+			     GPT, GPT_BYTE, 0);
 
   if (BUF_INTERVALS (current_buffer) != 0)
-    offset_intervals (current_buffer, GPT, nchars);
+    {
+      offset_intervals (current_buffer, GPT - nchars, nchars);
+      graft_intervals_into_buffer (NULL_INTERVAL, GPT - nchars, nchars,
+				   current_buffer, 0);
+    }
 
   if (GPT - nchars < PT)
     adjust_point (nchars, nbytes);