aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>2007-04-29 21:57:33 +0000
committerRichard M. Stallman <[email protected]>2007-04-29 21:57:33 +0000
commitbec1aca2ee97c2b4c61dc6e1b00b1653f4f5a8c7 (patch)
tree3709773db1e041ab38773e3d990f08b9aebf89aa
parent2ad08150952f3d3cc7212dec97fb330fa5c3f778 (diff)
(replace_range): For undo, record insertion first.
-rw-r--r--src/insdel.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/insdel.c b/src/insdel.c
index 7f15f7de52..65d60b6b8e 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -1603,8 +1603,12 @@ replace_range (from, to, new, prepare, inherit, markers)
if (! EQ (current_buffer->undo_list, Qt))
{
+ /* Record the insertion first, so that when we undo,
+ the deletion will be undone first. Thus, undo
+ will insert before deleting, and thus will keep
+ the markers before and after this text separate. */
+ record_insert (from + SCHARS (deletion), inschars);
record_delete (from, deletion);
- record_insert (from, inschars);
}
GAP_SIZE -= outgoing_insbytes;