summaryrefslogtreecommitdiff
path: root/src/insdel.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2001-11-11 20:04:45 +0000
committerRichard M. Stallman <rms@gnu.org>2001-11-11 20:04:45 +0000
commit048a0fbbb1f0b1b2abf640f78454fd94ead9683d (patch)
tree280caf5b40dc0f8a90e1f0a8670121e7b3856f90 /src/insdel.c
parent886ed6ec125599d2dd4d55151300fa5c9ff004a8 (diff)
downloademacs-048a0fbbb1f0b1b2abf640f78454fd94ead9683d.tar.gz
(replace_range): Use adjust_markers_for_replace
instead of adjust_markers_for_delete and adjust_markers_for_insert.
Diffstat (limited to 'src/insdel.c')
-rw-r--r--src/insdel.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/insdel.c b/src/insdel.c
index 24bfe8a893c..63bd06d0846 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -1423,13 +1423,6 @@ replace_range (from, to, new, prepare, inherit, markers)
if (! EQ (current_buffer->undo_list, Qt))
deletion = make_buffer_string_both (from, from_byte, to, to_byte, 1);
- if (markers)
- /* Relocate all markers pointing into the new, larger gap
- to point at the end of the text before the gap.
- Do this before recording the deletion,
- so that undo handles this after reinserting the text. */
- adjust_markers_for_delete (from, from_byte, to, to_byte);
-
GAP_SIZE += nbytes_del;
ZV -= nchars_del;
Z -= nchars_del;
@@ -1489,10 +1482,11 @@ replace_range (from, to, new, prepare, inherit, markers)
adjusting the markers that bound the overlays. */
adjust_overlays_for_delete (from, nchars_del);
adjust_overlays_for_insert (from, inschars);
+
+ /* Adjust markers for the deletion and the insertion. */
if (markers)
- adjust_markers_for_insert (from, from_byte,
- from + inschars, from_byte + outgoing_insbytes,
- 0);
+ adjust_markers_for_replace (from, from_byte, nchars_del, nbytes_del,
+ inschars, outgoing_insbytes);
offset_intervals (current_buffer, from, inschars - nchars_del);