aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKarl Heuer1995-04-17 23:16:23 +0000
committerKarl Heuer1995-04-17 23:16:23 +0000
commitadde48587ad06ed296b5d71431fd5d361027d46e (patch)
tree5cf78f4c1c155dedba050f6e4fa7f1381c23c052 /src
parent423cdb46171a8de20a3fe07049da51989fd2acf8 (diff)
downloademacs-adde48587ad06ed296b5d71431fd5d361027d46e.tar.gz
emacs-adde48587ad06ed296b5d71431fd5d361027d46e.zip
(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')
-rw-r--r--src/insdel.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/insdel.c b/src/insdel.c
index 8d2f1b08bce..449bfc58b31 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -370,6 +370,7 @@ insert_1 (string, length, inherit, prepare)
370 GPT += length; 370 GPT += length;
371 ZV += length; 371 ZV += length;
372 Z += length; 372 Z += length;
373 adjust_overlays_for_insert (PT, length);
373 adjust_point (length); 374 adjust_point (length);
374 375
375#ifdef USE_TEXT_PROPERTIES 376#ifdef USE_TEXT_PROPERTIES
@@ -436,6 +437,7 @@ insert_from_string_1 (string, pos, length, inherit)
436 GPT += length; 437 GPT += length;
437 ZV += length; 438 ZV += length;
438 Z += length; 439 Z += length;
440 adjust_overlays_for_insert (PT, length);
439 441
440 /* Only defined if Emacs is compiled with USE_TEXT_PROPERTIES */ 442 /* Only defined if Emacs is compiled with USE_TEXT_PROPERTIES */
441 graft_intervals_into_buffer (XSTRING (string)->intervals, PT, length, 443 graft_intervals_into_buffer (XSTRING (string)->intervals, PT, length,
@@ -510,6 +512,7 @@ insert_from_buffer_1 (buf, pos, length, inherit)
510 GPT += length; 512 GPT += length;
511 ZV += length; 513 ZV += length;
512 Z += length; 514 Z += length;
515 adjust_overlays_for_insert (PT, length);
513 adjust_point (length); 516 adjust_point (length);
514 517
515 /* Only defined if Emacs is compiled with USE_TEXT_PROPERTIES */ 518 /* Only defined if Emacs is compiled with USE_TEXT_PROPERTIES */
@@ -636,6 +639,10 @@ del_range_1 (from, to, prepare)
636 to point at the end of the text before the gap. */ 639 to point at the end of the text before the gap. */
637 adjust_markers (to + GAP_SIZE, to + GAP_SIZE, - numdel - GAP_SIZE); 640 adjust_markers (to + GAP_SIZE, to + GAP_SIZE, - numdel - GAP_SIZE);
638 641
642 /* Adjust the overlay center as needed. This must be done after
643 adjusting the markers that bound the overlays. */
644 adjust_overlays_for_delete (from, numdel);
645
639 GAP_SIZE += numdel; 646 GAP_SIZE += numdel;
640 ZV -= numdel; 647 ZV -= numdel;
641 Z -= numdel; 648 Z -= numdel;