aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman2001-11-11 20:04:45 +0000
committerRichard M. Stallman2001-11-11 20:04:45 +0000
commit048a0fbbb1f0b1b2abf640f78454fd94ead9683d (patch)
tree280caf5b40dc0f8a90e1f0a8670121e7b3856f90 /src
parent886ed6ec125599d2dd4d55151300fa5c9ff004a8 (diff)
downloademacs-048a0fbbb1f0b1b2abf640f78454fd94ead9683d.tar.gz
emacs-048a0fbbb1f0b1b2abf640f78454fd94ead9683d.zip
(replace_range): Use adjust_markers_for_replace
instead of adjust_markers_for_delete and adjust_markers_for_insert.
Diffstat (limited to 'src')
-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)
1423 if (! EQ (current_buffer->undo_list, Qt)) 1423 if (! EQ (current_buffer->undo_list, Qt))
1424 deletion = make_buffer_string_both (from, from_byte, to, to_byte, 1); 1424 deletion = make_buffer_string_both (from, from_byte, to, to_byte, 1);
1425 1425
1426 if (markers)
1427 /* Relocate all markers pointing into the new, larger gap
1428 to point at the end of the text before the gap.
1429 Do this before recording the deletion,
1430 so that undo handles this after reinserting the text. */
1431 adjust_markers_for_delete (from, from_byte, to, to_byte);
1432
1433 GAP_SIZE += nbytes_del; 1426 GAP_SIZE += nbytes_del;
1434 ZV -= nchars_del; 1427 ZV -= nchars_del;
1435 Z -= nchars_del; 1428 Z -= nchars_del;
@@ -1489,10 +1482,11 @@ replace_range (from, to, new, prepare, inherit, markers)
1489 adjusting the markers that bound the overlays. */ 1482 adjusting the markers that bound the overlays. */
1490 adjust_overlays_for_delete (from, nchars_del); 1483 adjust_overlays_for_delete (from, nchars_del);
1491 adjust_overlays_for_insert (from, inschars); 1484 adjust_overlays_for_insert (from, inschars);
1485
1486 /* Adjust markers for the deletion and the insertion. */
1492 if (markers) 1487 if (markers)
1493 adjust_markers_for_insert (from, from_byte, 1488 adjust_markers_for_replace (from, from_byte, nchars_del, nbytes_del,
1494 from + inschars, from_byte + outgoing_insbytes, 1489 inschars, outgoing_insbytes);
1495 0);
1496 1490
1497 offset_intervals (current_buffer, from, inschars - nchars_del); 1491 offset_intervals (current_buffer, from, inschars - nchars_del);
1498 1492