changeset 11474:510885be2758

(insert_1): Adjust overlay center after inserting. (insert_from_string_1, insert_from_buffer_1): Likewise. (del_range_1): Adjust overlay center after deleting.
author Karl Heuer <kwzh@gnu.org>
date Mon, 17 Apr 1995 23:16:23 +0000
parents 24ede15e0aaa
children 64aa0d436a80
files src/insdel.c
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/insdel.c	Mon Apr 17 23:13:56 1995 +0000
+++ b/src/insdel.c	Mon Apr 17 23:16:23 1995 +0000
@@ -370,6 +370,7 @@
   GPT += length;
   ZV += length;
   Z += length;
+  adjust_overlays_for_insert (PT, length);
   adjust_point (length);
 
 #ifdef USE_TEXT_PROPERTIES
@@ -436,6 +437,7 @@
   GPT += length;
   ZV += length;
   Z += length;
+  adjust_overlays_for_insert (PT, length);
 
   /* Only defined if Emacs is compiled with USE_TEXT_PROPERTIES */
   graft_intervals_into_buffer (XSTRING (string)->intervals, PT, length,
@@ -510,6 +512,7 @@
   GPT += length;
   ZV += length;
   Z += length;
+  adjust_overlays_for_insert (PT, length);
   adjust_point (length);
 
   /* Only defined if Emacs is compiled with USE_TEXT_PROPERTIES */
@@ -636,6 +639,10 @@
      to point at the end of the text before the gap.  */
   adjust_markers (to + GAP_SIZE, to + GAP_SIZE, - numdel - GAP_SIZE);
 
+  /* Adjust the overlay center as needed.  This must be done after
+   adjusting the markers that bound the overlays.  */
+  adjust_overlays_for_delete (from, numdel);
+
   GAP_SIZE += numdel;
   ZV -= numdel;
   Z -= numdel;