aboutsummaryrefslogtreecommitdiffstats
path: root/src/insdel.c
diff options
context:
space:
mode:
authorKarl Heuer <[email protected]>1995-04-17 23:16:23 +0000
committerKarl Heuer <[email protected]>1995-04-17 23:16:23 +0000
commitadde48587ad06ed296b5d71431fd5d361027d46e (patch)
tree5cf78f4c1c155dedba050f6e4fa7f1381c23c052 /src/insdel.c
parent423cdb46171a8de20a3fe07049da51989fd2acf8 (diff)
(insert_1): Adjust overlay center after inserting.
(insert_from_string_1, insert_from_buffer_1): Likewise. (del_range_1): Adjust overlay center after deleting.
Diffstat (limited to 'src/insdel.c')
-rw-r--r--src/insdel.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/insdel.c b/src/insdel.c
index 8d2f1b08bc..449bfc58b3 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -370,6 +370,7 @@ insert_1 (string, length, inherit, prepare)
GPT += length;
ZV += length;
Z += length;
+ adjust_overlays_for_insert (PT, length);
adjust_point (length);
#ifdef USE_TEXT_PROPERTIES
@@ -436,6 +437,7 @@ insert_from_string_1 (string, pos, length, inherit)
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 @@ insert_from_buffer_1 (buf, pos, length, inherit)
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 @@ del_range_1 (from, to, prepare)
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;